dc-l1-capetown-waterway-nulls
Map (reference ← swipe → agent)
0:00
Hi, first time asking for help with this. The contractor delivered capetown_waterways.geojson but some features are unusable for our mapping pipeline. Drop any features that cannot represent a valid, usable waterway (a feature needs both a drawable geometry and a proper type to be useful) and keep the rest. I'd also like a top-level dropped_count so I can show my supervisor what we're flagging back at the contractor. Filename waterways_clean.geojson, please.
The output should contain only LineString features, each preserving all original columns, with feature_id as the key field. The FeatureCollection must include a top-level dropped_count foreign member (an integer) reporting how many features were removed.
0:00
System info
{
"adapter": "openrouter",
"model": "google/gemma-4-26b-a4b-it",
"base_url": "https://openrouter.ai/api/v1"
}
0:01
Bash
ls -l
total 44 -rw-r--r-- 1 agent agent 42876 Jun 16 14:15 capetown_waterways.geojson
0:13
Write
/work/solve.py
content · 57 lines · py
import geopandas as gpd
import json
def clean_waterways(input_file, output_file):
# Load the GeoJSON file
gdf = gpd.read_file(input_file)
initial_count = len(gdf)
print(f"Initial feature count: {initial_count}")
# 1. Keep only LineString features
# Note: MultiLineString might be useful, but the prompt specifically says "only LineString features"
# Let's check if the user meant geometry type in general or specifically LineString.
# "The output should contain only LineString features"
# Filter for valid LineString geometries
# We also need to ensure they are not empty or invalid
mask = (gdf.geometry.type == 'LineString') & (gdf.geometry.is_valid) & (~gdf.geometry.is_empty)
# The prompt also mentions "a proper type to be useful".
# Usually in waterways, this refers to a 'type' column or similar,
# but since no schema is provided, I will assume "LineString" is the type filter required
# for the geometry aspect, and "valid geometry" for the "drawable" aspect.
# Wait, "a feature needs both a drawable geometry and a proper type to be useful"
# Does "type" refer to a column in the data or the geometry type?
# Given "The output should contain only LineString features", it is highly likely
# 'type' refers to a property in the attributes OR the geometry type.
# However, if I filter by LineString, I am already handling the geometry type.
# Let's inspect the columns first.
gdf_clean = gdf[mask].copy()
dropped_count = initial_count - len(gdf_clean)
print(f"Dropped count: {dropped_count}")
print(f"Cleaned feature count: {len(gdf_clean)}")
# Prepare the output GeoJSON with the top-level dropped_count
# To include a top-level member in GeoJSON, we can't just use gdf.to_file()
# because that follows the standard FeatureCollection structure.
# We need to construct the dictionary manually.
# Convert the cleaned GeoDataFrame to a GeoJSON-like dict
# We use the __geo_interface__ or similar to get the features
features = gdf_clean.__geo_interface__['features']
output_dict = {
"type": "FeatureCollection",
"features": features,
"dropped_count": dropped_count
}
with open(output_file, 'w') as f:
json.dump(output_dict, f)
if __name__ == "__main__":
clean_waterways('capetown_waterways.geojson', 'waterways_clean.geojson')
Wrote /work/solve.py (2456 chars).
0:14
Read
capetown_waterways.geojson
1 {
2 "type": "FeatureCollection",
3 "name": "capetown_waterways",
4 "crs": {
5 "type": "name",
6 "properties": {
7 "name": "urn:ogc:def:crs:OGC:1.3:CRS84"
8 }
9 },
10 "features": [
<system-reminder>Showed lines 1-10 of 2287. Re-call Read with offset=11 to continue, or raise limit.</system-reminder>
0:16
Bash
python solve.py
Initial feature count: 100 Dropped count: 15 Cleaned feature count: 85
0:21
Read
waterways_clean.geojson
1 {"type": "FeatureCollection", "features": [{"id": "15", "type": "Feature", "properties": {"feature_id": 16, "name": "Steenbras Stream", "waterway_type": null}, "geometry": {"type": "LineString", "coordinates": [[18.675131, -34.097358], [18.644434, -34.095261], [18.593333, -34.054287]]}, "bbox": [18.593333, -34.097358, 18.675131, -34.054287]}, {"id": "16", "type": "Feature", "properties": {"feature_id": 17, "name": "Sir Lowry Stream", "waterway_type": null}, "geometry": {"type": "LineString", "coordinates": [[18.476831, -34.056422], [18.432213, -34.00126], [18.38696, -33.920017]]}, "bbox": [18.38696, -34.056422, 18.476831, -33.920017]}, {"id": "17", "type": "Feature", "properties": {"feature_id": 18, "name": "Constantia River", "waterway_type": null}, "geometry": {"type": "LineString", "coordinates": [[18.350029, -33.922963], [18.357716, -33.862693], [18.38548, -33.811815]]}, "bbox": [18.350029, -33.922963, 18.38548, -33.811815]}, {"id": "18", "type": "Feature", "properties": {"feature_id": 19, "name": "Klipfontein Stream", "waterway_type": null}, "geometry": {"type": "LineString", "coordinates": [[18.482936, -33.81301], [18.531519, -33.800031], [18.591089, -33.823751]]}, "bbox": [18.482936, -33.823751, 18.591089, -33.800031]}, {"id": "19", "type": "Feature", "properties": {"feature_id": 20, "name": "Plumstead Stream", "waterway_type": null}, "geometry": {"type": "LineString", "coordinates": [[18.678279, -33.822156], [18.695646, -33.867752], [18.698602, -33.945448]]}, "bbox": [18.678279, -33.945448, 18.698602, -33.822156]}, {"id": "20", "type": "Feature", "properties": {"feature_id": 21, "name": null, "waterway_type": "river"}, "geometry": {"type": "LineString", "coordinates": [[18.64611, -33.94245], [18.606483, -34.006979], [18.548438, -34.071103]]}, "bbox": [18.548438, -34.071103, 18.64611, -33.94245]}, {"id": "21", "type": "Feature", "properties": {"feature_id": 22, "name": null, "waterway_type": "drain"}, "geometry": {"type": "LineString", "coordinates": [[18.434177, -34.069308], [18.396375, -34.096669], [18.363484, -34.091471]]}, "bbox": [18.363484, -34.096669, 18.434177, -34.069308]}, {"id": "22", "type": "Feature", "properties": {"feature_id": 23, "name": null, "waterway_type": "canal"}, "geometry": {"type": "LineString", "coordinates": [[18.357053, -34.092439], [18.377185, -34.058844], [18.418269, -33.988844]]}, "bbox": [18.357053, -34.092439, 18.418269, -33.988844]}, {"id": "23", "type": "Feature", "properties": {"feature_id": 24, "name": null, "waterway_type": "ditch"}, "geometry": {"type": "LineString", "coordinates": [[18.529212, -33.991734], [18.577397, -33.92639], [18.631474, -33.852446]]}, "bbox": [18.529212, -33.991734, 18.631474, -33.852446]}, {"id": "24", "type": "Feature", "properties": {"feature_id": 25, "name": null, "waterway_type": "stream"}, "geometry": {"type": "LineString", "coordinates": [[18.69512, -33.854745], [18.699836, -33.814463], [18.68664, -33.800862]]}, "bbox": [18.68664, -33.854745, 18.699836, -33.800862]}, {"id": "25", "type": "Feature", "properties": {"feature_id": 26, "name": "Liesbeek Stream", "waterway_type": "river"}, "geometry": {"type": "LineString", "coordinates": [[18.608518, -33.800571], [18.562766, -33.820372], [18.501884, -33.878938]]}, "bbox": [18.501884, -33.878938, 18.608518, -33.800571]}, {"id": "26", "type": "Feature", "properties": {"feature_id": 27, "name": "Black River River", "waterway_type": "drain"}, "geometry": {"type": "LineString", "coordinates": [[18.397951, -33.876311], [18.36964, -33.938979], [18.351439, -34.018796]]}, "bbox": [18.351439, -34.018796, 18.397951, -33.876311]}, {"id": "27", "type": "Feature", "properties": {"feature_id": 28, "name": "Salt Stream", "waterway_type": "canal"}, "geometry": {"type": "LineString", "coordinates": [[18.375963, -34.016116], [18.407114, -34.067168], [18.458611, -34.098842]]}, "bbox": [18.375963, -34.098842, 18.458611, -34.016116]}, {"id": "28", "type": "Feature", "properties": {"feature_id": 29, "name": "Diep Stream", "waterway_type": "ditch"}, "geometry": {"type": "LineString", "coordinates": [[18.575191, -34.09844], [18.619566, -34.093491], [18.664324, -34.049485]]}, "bbox": [18.575191, -34.09844, 18.664324, -34.049485]}, {"id": "29", "type": "Feature", "properties": {"feature_id": 30, "name": "Eerste River", "waterway_type": "stream"}, "geometry": {"type": "LineString", "coordinates": [[18.699921, -34.05171], [18.691653, -33.995063], [18.663239, -33.913635]]}, "bbox": [18.663239, -34.05171, 18.699921, -33.913635]}, {"id": "30", "type": "Feature", "properties": {"feature_id": 31, "name": "Lourens Stream", "waterway_type": "river"}, "geometry": {"type": "LineString", "coordinates": [[18.565016, -33.916553], [18.516377, -33.857457], [18.456965, -33.809401]]}, "bbox": [18.456965, -33.916553, 18.565016, -33.809401]}, {"id": "31", "type": "Feature", "properties": {"feature_id": 32, "name": "Hout Bay Stream", "waterway_type": "drain"}, "geometry": {"type": "LineString", "coordinates": [[18.370716, -33.810475], [18.3539, -33.800308], [18.351676, -33.827404]]}, "bbox": [18.351676, -33.827404, 18.370716, -33.800308]}, {"id": "32", "type": "Feature", "properties": {"feature_id": 33, "name": "Disa River", "waterway_type": "canal"}, "geometry": {"type": "LineString", "coordinates": [[18.405419, -33.8257], [18.445387, -33.873302], [18.503651, -33.951992]]}, "bbox": [18.405419, -33.951992, 18.503651, -33.8257]}, {"id": "33", "type": "Feature", "properties": {"feature_id": 34, "name": "Sand Stream", "waterway_type": "ditch"}, "geometry": {"type": "LineString", "coordinates": [[18.617617, -33.948992], [18.655044, -34.012977], [18.687315, -34.074848]]}, "bbox": [18.617617, -34.074848, 18.687315, -33.948992]}, {"id": "34", "type": "Feature", "properties": {"feature_id": 35, "name": "Soet Stream", "waterway_type": "stream"}, "geometry": {"type": "LineString", "coordinates": [[18.692343, -34.07316], [18.671677, -34.0979], [18.630054, -34.089161]]}, "bbox": [18.630054, -34.0979, 18.692343, -34.07316]}, {"id": "35", "type": "Feature", "properties": {"feature_id": 36, "name": "Klein Liesbeek River", "waterway_type": "river"}, "geometry": {"type": "LineString", "coordinates": [[18.518682, -34.090253], [18.470597, -34.054239], [18.416862, -33.982488]]}, "bbox": [18.416862, -34.090253, 18.518682, -33.982488]}, {"id": "36", "type": "Feature", "properties": {"feature_id": 37, "name": "Kuils Stream", "waterway_type": "drain"}, "geometry": {"type": "LineString", "coordinates": [[18.354399, -33.98541], [18.350268, -33.919952], [18.364179, -33.847569]]}, "bbox": [18.350268, -33.98541, 18.364179, -33.847569]}, {"id": "37", "type": "Feature", "properties": {"feature_id": 38, "name": "Modder Stream", "waterway_type": "canal"}, "geometry": {"type": "LineString", "coordinates": [[18.443339, -33.849781], [18.489293, -33.811789], [18.550203, -33.801704]]}, "bbox": [18.443339, -33.849781, 18.550203, -33.801704]}, {"id": "38", "type": "Feature", "properties": {"feature_id": 39, "name": "Princess Vlei River", "waterway_type": "ditch"}, "geometry": {"type": "LineString", "coordinates": [[18.653489, -33.801283], [18.681318, -33.823787], [18.698818, -33.884768]]}, "bbox": [18.653489, -33.884768, 18.698818, -33.801283]}, {"id": "39", "type": "Feature", "properties": {"feature_id": 40, "name": "Riet Stream", "waterway_type": "stream"}, "geometry": {"type": "LineString", "coordinates": [[18.672923, -33.882079], [18.64132, -33.945514], [18.589435, -34.024544]]}, "bbox": [18.589435, -34.024544, 18.672923, -33.882079]}, {"id": "40", "type": "Feature", "properties": {"feature_id": 41, "name": "Schaapen Stream", "waterway_type": "river"}, "geometry": {"type": "LineString", "coordinates": [[18.472795, -34.021926], [18.428668, -34.071142], [18.384411, -34.099512]]}, "bbox": [18.384411, -34.099512, 18.472795, -34.021926]}, {"id": "41", "type": "Feature", "properties": {"feature_id": 42, "name": "Steenbras River", "waterway_type": "drain"}, "geometry": {"type": "LineString", "coordinates": [[18.350155, -34.09924], [18.359001, -34.091448], [18.388063, -34.044494]]}, "bbox": [18.350155, -34.09924, 18.388063, -34.044494]}, {"id": "42", "type": "Feature", "properties": {"feature_id": 43, "name": "Sir Lowry Stream", "waterway_type": "canal"}, "geometry": {"type": "LineString", "coordinates": [[18.487037, -34.046805], [18.535726, -33.98878], [18.59497, -33.907323]]}, "bbox": [18.487037, -34.046805, 18.59497, -33.907323]}, {"id": "43", "type": "Feature", "properties": {"feature_id": 44, "name": "Constantia Stream", "waterway_type": "ditch"}, "geometry": {"type": "LineString", "coordinates": [[18.680267, -33.910207], [18.69653, -33.852396], [18.698021, -33.807255]]}, "bbox": [18.680267, -33.910207, 18.698021, -33.807255]}, {"id": "44", "type": "Feature", "properties": {"feature_id": 45, "name": "Klipfontein River", "waterway_type": "stream"}, "geometry": {"type": "LineString", "coordinates": [[18.643034, -33.808206], [18.602732, -33.800869], [18.544256, -33.83129]]}, "bbox": [18.544256, -33.83129, 18.643034, -33.800869]}, {"id": "45", "type": "Feature", "properties": {"feature_id": 46, "name": "Plumstead Stream", "waterway_type": "river"}, "geometry": {"type": "LineString", "coordinates": [[18.430603, -33.82948], [18.393556, -33.878997], [18.36191, -33.958531]]}, "bbox": [18.36191, -33.958531, 18.430603, -33.82948]}, {"id": "46", "type": "Feature", "properties": {"feature_id": 47, "name": "Camps Bay Stream", "waterway_type": "drain"}, "geometry": {"type": "LineString", "coordinates": [[18.358285, -33.955535], [18.379483, -34.018855], [18.421638, -34.078355]]}, "bbox": [18.358285, -34.078355, 18.421638, -33.955535]}, {"id": "47", "type": "Feature", "properties": {"feature_id": 48, "name": "Bokramspruit River", "waterway_type": "canal"}, "geometry": {"type": "LineString", "coordinates": [[18.533422, -34.076777], [18.581401, -34.09885], [18.634786, -34.086587]]}, "bbox": [18.533422, -34.09885, 18.634786, -34.076777]}, {"id": "48", "type": "Feature", "properties": {"feature_id": 49, "name": "Mosselbank Stream", "waterway_type": "ditch"}, "geometry": {"type": "LineString", "coordinates": [[18.696058, -34.0878], [18.699603, -34.049435], [18.684979, -33.97607]]}, "bbox": [18.684979, -34.0878, 18.699603, -33.97607]}, {"id": "49", "type": "Feature", "properties": {"feature_id": 50, "name": "Skoolspruit Stream", "waterway_type": "stream"}, "geometry": {"type": "LineString", "coordinates": [[18.604792, -33.979019], [18.558642, -33.913571], [18.497715, -33.842887]]}, "bbox": [18.497715, -33.979019, 18.604792, -33.842887]}, {"id": "50", "type": "Feature", "properties": {"feature_id": 51, "name": "Vergenoegd River", "waterway_type": "river"}, "geometry": {"type": "LineString", "coordinates": [[18.395091, -33.845009], [18.367746, -33.809378], [18.35095, -33.802829]]}, "bbox": [18.35095, -33.845009, 18.395091, -33.802829]}, {"id": "51", "type": "Feature", "properties": {"feature_id": 52, "name": "Liesbeek Stream", "waterway_type": "drain"}, "geometry": {"type": "LineString", "coordinates": [[18.378214, -33.802278], [18.410262, -33.827442], [18.462528, -33.890721]]}, "bbox": [18.378214, -33.890721, 18.462528, -33.802278]}, {"id": "52", "type": "Feature", "properties": {"feature_id": 53, "name": "Black River Stream", "waterway_type": "canal"}, "geometry": {"type": "LineString", "coordinates": [[18.579211, -33.887977], [18.623083, -33.952058], [18.666833, -34.03015]]}, "bbox": [18.579211, -34.03015, 18.666833, -33.887977]}, {"id": "53", "type": "Feature", "properties": {"feature_id": 54, "name": "Salt River", "waterway_type": "ditch"}, "geometry": {"type": "LineString", "coordinates": [[18.699743, -34.027599], [18.69032, -34.074885], [18.660616, -34.099897]]}, "bbox": [18.660616, -34.099897, 18.699743, -34.027599]}, {"id": "54", "type": "Feature", "properties": {"feature_id": 55, "name": "Diep Stream", "waterway_type": "stream"}, "geometry": {"type": "LineString", "coordinates": [[18.560904, -34.099756], [18.512172, -34.089136], [18.453104, -34.039323]]}, "bbox": [18.453104, -34.099756, 18.560904, -34.039323]}, {"id": "55", "type": "Feature", "properties": {"feature_id": 56, "name": "Eerste Stream", "waterway_type": "river"}, "geometry": {"type": "LineString", "coordinates": [[18.368772, -34.041715], [18.353065, -33.982423], [18.352308, -33.901092]]}, "bbox": [18.352308, -34.041715, 18.368772, -33.901092]}, {"id": "56", "type": "Feature", "properties": {"feature_id": 57, "name": "Lourens River", "waterway_type": "drain"}, "geometry": {"type": "LineString", "coordinates": [[18.40853, -33.903937], [18.449161, -33.847521], [18.507838, -33.805381]]}, "bbox": [18.40853, -33.903937, 18.507838, -33.805381]}, {"id": "57", "type": "Feature", "properties": {"feature_id": 58, "name": "Hout Bay Stream", "waterway_type": "canal"}, "geometry": {"type": "LineString", "coordinates": [[18.621164, -33.806206], [18.657825, -33.801714], [18.688842, -33.835403]]}, "bbox": [18.621164, -33.835403, 18.688842, -33.801714]}, {"id": "58", "type": "Feature", "properties": {"feature_id": 59, "name": "Disa Stream", "waterway_type": "ditch"}, "geometry": {"type": "LineString", "coordinates": [[18.691062, -33.83349], [18.669337, -33.884828], [18.626655, -33.965055]]}, "bbox": [18.626655, -33.965055, 18.691062, -33.83349]}, {"id": "59", "type": "Feature", "properties": {"feature_id": 60, "name": "Sand River", "waterway_type": "stream"}, "geometry": {"type": "LineString", "coordinates": [[18.514474, -33.962067], [18.466609, -34.024602], [18.413581, -34.081619]]}, "bbox": [18.413581, -34.081619, 18.514474, -33.962067]}, {"id": "60", "type": "Feature", "properties": {"feature_id": 61, "name": "Soet Stream", "waterway_type": "river"}, "geometry": {"type": "LineString", "coordinates": [[18.35351, -34.080153], [18.350551, -34.099517], [18.365886, -34.083753]]}, "bbox": [18.350551, -34.099517, 18.365886, -34.080153]}, {"id": "61", "type": "Feature", "properties": {"feature_id": 62, "name": "Klein Liesbeek Stream", "waterway_type": "drain"}, "geometry": {"type": "LineString", "coordinates": [[18.447088, -34.085084], [18.493427, -34.044442], [18.554364, -33.969602]]}, "bbox": [18.447088, -34.085084, 18.554364, -33.969602]}, {"id": "62", "type": "Feature", "properties": {"feature_id": 63, "name": "Kuils River", "waterway_type": "canal"}, "geometry": {"type": "LineString", "coordinates": [[18.656311, -33.972572], [18.683167, -33.907259], [18.699257, -33.838409]]}, "bbox": [18.656311, -33.972572, 18.699257, -33.838409]}, {"id": "63", "type": "Feature", "properties": {"feature_id": 64, "name": "Modder Stream", "waterway_type": "ditch"}, "geometry": {"type": "LineString", "coordinates": [[18.670629, -33.840436], [18.638139, -33.807235], [18.5855, -33.804233]]}, "bbox": [18.5855, -33.840436, 18.670629, -33.804233]}, {"id": "64", "type": "Feature", "properties": {"feature_id": 65, "name": "Princess Vlei Stream", "waterway_type": "stream"}, "geometry": {"type": "LineString", "coordinates": [[18.46879, -33.803555], [18.425179, -33.831331], [18.381943, -33.896787]]}, "bbox": [18.381943, -33.896787, 18.46879, -33.803555]}, {"id": "65", "type": "Feature", "properties": {"feature_id": 66, "name": "Riet River", "waterway_type": "river"}, "geometry": {"type": "LineString", "coordinates": [[18.350383, -33.893993], [18.360383, -33.958598], [18.390725, -34.035604]]}, "bbox": [18.350383, -34.035604, 18.390725, -33.893993]}, {"id": "66", "type": "Feature", "properties": {"feature_id": 67, "name": "Schaapen Stream", "waterway_type": "drain"}, "geometry": {"type": "LineString", "coordinates": [[18.491161, -34.033124], [18.539928, -34.07839], [18.598811, -34.099997]]}, "bbox": [18.491161, -34.099997, 18.598811, -34.033124]}, {"id": "67", "type": "Feature", "properties": {"feature_id": 68, "name": "Steenbras Stream", "waterway_type": "canal"}, "geometry": {"type": "LineString", "coordinates": [[18.682166, -34.099986], [18.697315, -34.08656], [18.697339, -34.033982]]}, "bbox": [18.682166, -34.099986, 18.697339, -34.033982]}, {"id": "68", "type": "Feature", "properties": {"feature_id": 69, "name": "Sir Lowry River", "waterway_type": "ditch"}, "geometry": {"type": "LineString", "coordinates": [[18.63989, -34.036451], [18.598935, -33.976004], [18.540064, -33.894953]]}, "bbox": [18.540064, -34.036451, 18.63989, -33.894953]}, {"id": "69", "type": "Feature", "properties": {"feature_id": 70, "name": "Constantia Stream", "waterway_type": "stream"}, "geometry": {"type": "LineString", "coordinates": [[18.427083, -33.897755], [18.390813, -33.842841], [18.360429, -33.803782]]}, "bbox": [18.360429, -33.897755, 18.427083, -33.803782]}, {"id": "70", "type": "Feature", "properties": {"feature_id": 71, "name": "Klipfontein Stream", "waterway_type": "river"}, "geometry": {"type": "LineString", "coordinates": [[18.359614, -33.804481], [18.381865, -33.802842], [18.425067, -33.839733]]}, "bbox": [18.359614, -33.839733, 18.425067, -33.802842]}, {"id": "71", "type": "Feature", "properties": {"feature_id": 72, "name": "Plumstead River", "waterway_type": "drain"}, "geometry": {"type": "LineString", "coordinates": [[18.537628, -33.837721], [18.585372, -33.890782], [18.638035, -33.97155]]}, "bbox": [18.537628, -33.97155, 18.638035, -33.837721]}, {"id": "72", "type": "Feature", "properties": {"feature_id": 73, "name": "Camps Bay Stream", "waterway_type": "canal"}, "geometry": {"type": "LineString", "coordinates": [[18.696898, -33.968577], [18.699269, -34.030207], [18.683225, -34.084631]]}, "bbox": [18.683225, -34.084631, 18.699269, -33.968577]}, {"id": "73", "type": "Feature", "properties": {"feature_id": 74, "name": "Bokramspruit Stream", "waterway_type": "ditch"}, "geometry": {"type": "LineString", "coordinates": [[18.60102, -34.083282], [18.554499, -34.099899], [18.493562, -34.080664]]}, "bbox": [18.493562, -34.099899, 18.60102, -34.080664]}, {"id": "74", "type": "Feature", "properties": {"feature_id": 75, "name": "Mosselbank River", "waterway_type": "stream"}, "geometry": {"type": "LineString", "coordinates": [[18.392306, -34.082111], [18.365943, -34.039269], [18.350562, -33.963097]]}, "bbox": [18.350562, -34.082111, 18.392306, -33.963097]}, {"id": "75", "type": "Feature", "properties": {"feature_id": 76, "name": "Skoolspruit Stream", "waterway_type": "river"}, "geometry": {"type": "LineString", "coordinates": [[18.38055, -33.966083], [18.413476, -33.901029], [18.466481, -33.834144]]}, "bbox": [18.38055, -33.966083, 18.466481, -33.834144]}, {"id": "76", "type": "Feature", "properties": {"feature_id": 77, "name": "Vergenoegd Stream", "waterway_type": "drain"}, "geometry": {"type": "LineString", "coordinates": [[18.583201, -33.836072], [18.626544, -33.805364], [18.669259, -33.805916]]}, "bbox": [18.583201, -33.836072, 18.669259, -33.805364]}, {"id": "77", "type": "Feature", "properties": {"feature_id": 78, "name": "Liesbeek River", "waterway_type": "canal"}, "geometry": {"type": "LineString", "coordinates": [[18.699465, -33.80511], [18.68889, -33.835446], [18.657914, -33.902955]]}, "bbox": [18.657914, -33.902955, 18.699465, -33.80511]}, {"id": "78", "type": "Feature", "properties": {"feature_id": 79, "name": "Black River Stream", "waterway_type": "ditch"}, "geometry": {"type": "LineString", "coordinates": [[18.55677, -33.900116], [18.507975, -33.965121], [18.449284, -34.040895]]}, "bbox": [18.449284, -34.040895, 18.55677, -33.900116]}, {"id": "79", "type": "Feature", "properties": {"feature_id": 80, "name": "Salt Stream", "waterway_type": "stream"}, "geometry": {"type": "LineString", "coordinates": [[18.366919, -34.03849], [18.35233, -34.081651], [18.353039, -34.099811]]}, "bbox": [18.35233, -34.099811, 18.366919, -34.03849]}, {"id": "80", "type": "Feature", "properties": {"feature_id": 81, "name": "Diep River", "waterway_type": "river"}, "geometry": {"type": "LineString", "coordinates": [[18.411707, -34.099932], [18.452979, -34.083723], [18.512036, -34.028481]]}, "bbox": [18.411707, -34.099932, 18.512036, -34.028481]}, {"id": "81", "type": "Feature", "properties": {"feature_id": 82, "name": "Eerste Stream", "waterway_type": "drain"}, "geometry": {"type": "LineString", "coordinates": [[18.624656, -34.031022], [18.660529, -33.969536], [18.690275, -33.88892]]}, "bbox": [18.624656, -34.031022, 18.690275, -33.88892]}, {"id": "82", "type": "Feature", "properties": {"feature_id": 83, "name": "Lourens Stream", "waterway_type": "canal"}, "geometry": {"type": "LineString", "coordinates": [[18.689685, -33.891672], [18.666913, -33.838365], [18.623197, -33.802461]]}, "bbox": [18.623197, -33.891672, 18.689685, -33.802461]}, {"id": "83", "type": "Feature", "properties": {"feature_id": 84, "name": "Hout Bay River", "waterway_type": "ditch"}, "geometry": {"type": "LineString", "coordinates": [[18.510272, -33.803032], [18.462655, -33.804249], [18.410365, -33.844273]]}, "bbox": [18.410365, -33.844273, 18.510272, -33.803032]}, {"id": "84", "type": "Feature", "properties": {"feature_id": 85, "name": "Disa Stream", "waterway_type": "stream"}, "geometry": {"type": "LineString", "coordinates": [[18.35272, -33.842166], [18.350936, -33.896849], [18.367686, -33.978004]]}, "bbox": [18.350936, -33.978004, 18.367686, -33.842166]}, {"id": "85", "type": "Feature", "properties": {"feature_id": 86, "name": "Sand Stream", "waterway_type": "river"}, "geometry": {"type": "LineString", "coordinates": [[18.450883, -33.975051], [18.49758, -34.035659], [18.558508, -34.087388]]}, "bbox": [18.450883, -34.087388, 18.558508, -33.975051]}, {"id": "86", "type": "Feature", "properties": {"feature_id": 87, "name": "Soet River", "waterway_type": "drain"}, "geometry": {"type": "LineString", "coordinates": [[18.659058, -34.086157], [18.684924, -34.099996], [18.699594, -34.077327]]}, "bbox": [18.659058, -34.099996, 18.699594, -34.077327]}, {"id": "87", "type": "Feature", "properties": {"feature_id": 88, "name": "Klein Liesbeek Stream", "waterway_type": "canal"}, "geometry": {"type": "LineString", "coordinates": [[18.668251, -34.078887], [18.634893, -34.033927], [18.58153, -33.956568]]}, "bbox": [18.58153, -34.078887, 18.668251, -33.956568]}, {"id": "88", "type": "Feature", "properties": {"feature_id": 89, "name": "Kuils Stream", "waterway_type": "ditch"}, "geometry": {"type": "LineString", "coordinates": [[18.464817, -33.959563], [18.421748, -33.894891], [18.379559, -33.830098]]}, "bbox": [18.379559, -33.959563, 18.464817, -33.830098]}, {"id": "89", "type": "Feature", "properties": {"feature_id": 90, "name": "Modder River", "waterway_type": "stream"}, "geometry": {"type": "LineString", "coordinates": [[18.350713, -33.831925], [18.36186, -33.803767], [18.393466, -33.807872]]}, "bbox": [18.350713, -33.831925, 18.393466, -33.803767]}, {"id": "90", "type": "Feature", "properties": {"feature_id": 91, "name": "Princess Vlei Stream", "waterway_type": "river"}, "geometry": {"type": "LineString", "coordinates": [[18.495303, -33.806941], [18.544121, -33.839778], [18.602609, -33.909212]]}, "bbox": [18.495303, -33.909212, 18.602609, -33.806941]}, {"id": "91", "type": "Feature", "properties": {"feature_id": 92, "name": "Riet Stream", "waterway_type": "drain"}, "geometry": {"type": "LineString", "coordinates": [[18.683973, -33.906333], [18.698, -33.971616], [18.696557, -34.046013]]}, "bbox": [18.683973, -34.046013, 18.698, -33.906333]}, {"id": "92", "type": "Feature", "properties": {"feature_id": 93, "name": "Schaapen River", "waterway_type": "canal"}, "geometry": {"type": "LineString", "coordinates": [[18.636679, -34.043689], [18.595096, -34.084661], [18.535863, -34.09934]]}, "bbox": [18.535863, -34.09934, 18.636679, -34.043689]}, {"id": "93", "type": "Feature", "properties": {"feature_id": 94, "name": "Steenbras Stream", "waterway_type": "ditch"}, "geometry": {"type": "LineString", "coordinates": [[18.42362, -34.099592], [18.388148, -34.080632], [18.359045, -34.022831]]}, "bbox": [18.359045, -34.099592, 18.42362, -34.022831]}, {"id": "94", "type": "Feature", "properties": {"feature_id": 95, "name": "Sir Lowry Stream", "waterway_type": "stream"}, "geometry": {"type": "LineString", "coordinates": [[18.361039, -34.025439], [18.38433, -33.963031], [18.428554, -33.883003]]}, "bbox": [18.361039, -34.025439, 18.428554, -33.883003]}, {"id": "95", "type": "Feature", "properties": {"feature_id": 96, "name": "Constantia River", "waterway_type": "river"}, "geometry": {"type": "LineString", "coordinates": [[18.541825, -33.8857], [18.589308, -33.834101], [18.641218, -33.801421]]}, "bbox": [18.541825, -33.8857, 18.641218, -33.801421]}, {"id": "96", "type": "Feature", "properties": {"feature_id": 97, "name": "Klipfontein Stream", "waterway_type": "drain"}, "geometry": {"type": "LineString", "coordinates": [[18.697637, -33.801863], [18.698834, -33.805934], [18.68138, -33.849015]]}, "bbox": [18.68138, -33.849015, 18.698834, -33.801863]}, {"id": "97", "type": "Feature", "properties": {"feature_id": 98, "name": "Plumstead Stream", "waterway_type": "canal"}, "geometry": {"type": "LineString", "coordinates": [[18.597204, -33.846817], [18.550338, -33.903018], [18.489427, -33.984405]]}, "bbox": [18.489427, -33.984405, 18.597204, -33.846817]}, {"id": "98", "type": "Feature", "properties": {"feature_id": 99, "name": "Camps Bay River", "waterway_type": "ditch"}, "geometry": {"type": "LineString", "coordinates": [[18.389598, -33.981478], [18.364233, -34.040948], [18.350275, -34.089883]]}, "bbox": [18.350275, -34.089883, 18.389598, -33.981478]}, {"id": "99", "type": "Feature", "properties": {"feature_id": 100, "name": "Bokramspruit Stream", "waterway_type": "stream"}, "geometry": {"type": "LineString", "coordinates": [[18.382969, -34.088772], [18.416754, -34.099808], [18.470467, -34.073747]]}, "bbox": [18.382969, -34.099808, 18.470467, -34.073747]}], "dropped_count": 15}
0:34
Write
/work/solve.py
content · 47 lines · py
import geopandas as gpd
import json
def clean_waterways(input_file, output_file):
# Load the GeoJSON file
gdf = gpd.read_file(input_file)
initial_count = len(gdf)
print(f"Initial feature count: {initial_count}")
# A feature is valid if:
# 1. It has a LineString geometry
# 2. The geometry is valid and not empty
# 3. It has a 'waterway_type' that is not null/NaN
# Check for LineString and valid geometry
geom_mask = (gdf.geometry.type == 'LineString') & (gdf.geometry.is_valid) & (~gdf.geometry.is_empty)
# Check for "proper type" - interpreting this as 'waterway_type' column being present and not null
# based on the inspected file.
type_mask = gdf['waterway_type'].notnull()
# Combine masks
final_mask = geom_mask & type_mask
gdf_clean = gdf[final_mask].copy()
dropped_count = initial_count - len(gdf_clean)
print(f"Dropped count: {dropped_count}")
print(f"Cleaned feature count: {len(gdf_clean)}")
# Construct the GeoJSON FeatureCollection manually to include the top-level dropped_count
# We use the __geo_interface__ of the GeoDataFrame
features = gdf_clean.__geo_interface__['features']
output_dict = {
"type": "FeatureCollection",
"features": features,
"dropped_count": dropped_count
}
with open(output_file, 'w') as f:
json.dump(output_dict, f)
if __name__ == "__main__":
clean_waterways('capetown_waterways.geojson', 'waterways_clean.geojson')
Wrote /work/solve.py (1539 chars).
0:36
Bash
python solve.py
Initial feature count: 100 Dropped count: 20 Cleaned feature count: 80
0:41
Read
waterways_clean.geojson
1 {"type": "FeatureCollection", "features": [{"id": "20", "type": "Feature", "properties": {"feature_id": 21, "name": null, "waterway_type": "river"}, "geometry": {"type": "LineString", "coordinates": [[18.64611, -33.94245], [18.606483, -34.006979], [18.548438, -34.071103]]}, "bbox": [18.548438, -34.071103, 18.64611, -33.94245]}, {"id": "21", "type": "Feature", "properties": {"feature_id": 22, "name": null, "waterway_type": "drain"}, "geometry": {"type": "LineString", "coordinates": [[18.434177, -34.069308], [18.396375, -34.096669], [18.363484, -34.091471]]}, "bbox": [18.363484, -34.096669, 18.434177, -34.069308]}, {"id": "22", "type": "Feature", "properties": {"feature_id": 23, "name": null, "waterway_type": "canal"}, "geometry": {"type": "LineString", "coordinates": [[18.357053, -34.092439], [18.377185, -34.058844], [18.418269, -33.988844]]}, "bbox": [18.357053, -34.092439, 18.418269, -33.988844]}, {"id": "23", "type": "Feature", "properties": {"feature_id": 24, "name": null, "waterway_type": "ditch"}, "geometry": {"type": "LineString", "coordinates": [[18.529212, -33.991734], [18.577397, -33.92639], [18.631474, -33.852446]]}, "bbox": [18.529212, -33.991734, 18.631474, -33.852446]}, {"id": "24", "type": "Feature", "properties": {"feature_id": 25, "name": null, "waterway_type": "stream"}, "geometry": {"type": "LineString", "coordinates": [[18.69512, -33.854745], [18.699836, -33.814463], [18.68664, -33.800862]]}, "bbox": [18.68664, -33.854745, 18.699836, -33.800862]}, {"id": "25", "type": "Feature", "properties": {"feature_id": 26, "name": "Liesbeek Stream", "waterway_type": "river"}, "geometry": {"type": "LineString", "coordinates": [[18.608518, -33.800571], [18.562766, -33.820372], [18.501884, -33.878938]]}, "bbox": [18.501884, -33.878938, 18.608518, -33.800571]}, {"id": "26", "type": "Feature", "properties": {"feature_id": 27, "name": "Black River River", "waterway_type": "drain"}, "geometry": {"type": "LineString", "coordinates": [[18.397951, -33.876311], [18.36964, -33.938979], [18.351439, -34.018796]]}, "bbox": [18.351439, -34.018796, 18.397951, -33.876311]}, {"id": "27", "type": "Feature", "properties": {"feature_id": 28, "name": "Salt Stream", "waterway_type": "canal"}, "geometry": {"type": "LineString", "coordinates": [[18.375963, -34.016116], [18.407114, -34.067168], [18.458611, -34.098842]]}, "bbox": [18.375963, -34.098842, 18.458611, -34.016116]}, {"id": "28", "type": "Feature", "properties": {"feature_id": 29, "name": "Diep Stream", "waterway_type": "ditch"}, "geometry": {"type": "LineString", "coordinates": [[18.575191, -34.09844], [18.619566, -34.093491], [18.664324, -34.049485]]}, "bbox": [18.575191, -34.09844, 18.664324, -34.049485]}, {"id": "29", "type": "Feature", "properties": {"feature_id": 30, "name": "Eerste River", "waterway_type": "stream"}, "geometry": {"type": "LineString", "coordinates": [[18.699921, -34.05171], [18.691653, -33.995063], [18.663239, -33.913635]]}, "bbox": [18.663239, -34.05171, 18.699921, -33.913635]}, {"id": "30", "type": "Feature", "properties": {"feature_id": 31, "name": "Lourens Stream", "waterway_type": "river"}, "geometry": {"type": "LineString", "coordinates": [[18.565016, -33.916553], [18.516377, -33.857457], [18.456965, -33.809401]]}, "bbox": [18.456965, -33.916553, 18.565016, -33.809401]}, {"id": "31", "type": "Feature", "properties": {"feature_id": 32, "name": "Hout Bay Stream", "waterway_type": "drain"}, "geometry": {"type": "LineString", "coordinates": [[18.370716, -33.810475], [18.3539, -33.800308], [18.351676, -33.827404]]}, "bbox": [18.351676, -33.827404, 18.370716, -33.800308]}, {"id": "32", "type": "Feature", "properties": {"feature_id": 33, "name": "Disa River", "waterway_type": "canal"}, "geometry": {"type": "LineString", "coordinates": [[18.405419, -33.8257], [18.445387, -33.873302], [18.503651, -33.951992]]}, "bbox": [18.405419, -33.951992, 18.503651, -33.8257]}, {"id": "33", "type": "Feature", "properties": {"feature_id": 34, "name": "Sand Stream", "waterway_type": "ditch"}, "geometry": {"type": "LineString", "coordinates": [[18.617617, -33.948992], [18.655044, -34.012977], [18.687315, -34.074848]]}, "bbox": [18.617617, -34.074848, 18.687315, -33.948992]}, {"id": "34", "type": "Feature", "properties": {"feature_id": 35, "name": "Soet Stream", "waterway_type": "stream"}, "geometry": {"type": "LineString", "coordinates": [[18.692343, -34.07316], [18.671677, -34.0979], [18.630054, -34.089161]]}, "bbox": [18.630054, -34.0979, 18.692343, -34.07316]}, {"id": "35", "type": "Feature", "properties": {"feature_id": 36, "name": "Klein Liesbeek River", "waterway_type": "river"}, "geometry": {"type": "LineString", "coordinates": [[18.518682, -34.090253], [18.470597, -34.054239], [18.416862, -33.982488]]}, "bbox": [18.416862, -34.090253, 18.518682, -33.982488]}, {"id": "36", "type": "Feature", "properties": {"feature_id": 37, "name": "Kuils Stream", "waterway_type": "drain"}, "geometry": {"type": "LineString", "coordinates": [[18.354399, -33.98541], [18.350268, -33.919952], [18.364179, -33.847569]]}, "bbox": [18.350268, -33.98541, 18.364179, -33.847569]}, {"id": "37", "type": "Feature", "properties": {"feature_id": 38, "name": "Modder Stream", "waterway_type": "canal"}, "geometry": {"type": "LineString", "coordinates": [[18.443339, -33.849781], [18.489293, -33.811789], [18.550203, -33.801704]]}, "bbox": [18.443339, -33.849781, 18.550203, -33.801704]}, {"id": "38", "type": "Feature", "properties": {"feature_id": 39, "name": "Princess Vlei River", "waterway_type": "ditch"}, "geometry": {"type": "LineString", "coordinates": [[18.653489, -33.801283], [18.681318, -33.823787], [18.698818, -33.884768]]}, "bbox": [18.653489, -33.884768, 18.698818, -33.801283]}, {"id": "39", "type": "Feature", "properties": {"feature_id": 40, "name": "Riet Stream", "waterway_type": "stream"}, "geometry": {"type": "LineString", "coordinates": [[18.672923, -33.882079], [18.64132, -33.945514], [18.589435, -34.024544]]}, "bbox": [18.589435, -34.024544, 18.672923, -33.882079]}, {"id": "40", "type": "Feature", "properties": {"feature_id": 41, "name": "Schaapen Stream", "waterway_type": "river"}, "geometry": {"type": "LineString", "coordinates": [[18.472795, -34.021926], [18.428668, -34.071142], [18.384411, -34.099512]]}, "bbox": [18.384411, -34.099512, 18.472795, -34.021926]}, {"id": "41", "type": "Feature", "properties": {"feature_id": 42, "name": "Steenbras River", "waterway_type": "drain"}, "geometry": {"type": "LineString", "coordinates": [[18.350155, -34.09924], [18.359001, -34.091448], [18.388063, -34.044494]]}, "bbox": [18.350155, -34.09924, 18.388063, -34.044494]}, {"id": "42", "type": "Feature", "properties": {"feature_id": 43, "name": "Sir Lowry Stream", "waterway_type": "canal"}, "geometry": {"type": "LineString", "coordinates": [[18.487037, -34.046805], [18.535726, -33.98878], [18.59497, -33.907323]]}, "bbox": [18.487037, -34.046805, 18.59497, -33.907323]}, {"id": "43", "type": "Feature", "properties": {"feature_id": 44, "name": "Constantia Stream", "waterway_type": "ditch"}, "geometry": {"type": "LineString", "coordinates": [[18.680267, -33.910207], [18.69653, -33.852396], [18.698021, -33.807255]]}, "bbox": [18.680267, -33.910207, 18.698021, -33.807255]}, {"id": "44", "type": "Feature", "properties": {"feature_id": 45, "name": "Klipfontein River", "waterway_type": "stream"}, "geometry": {"type": "LineString", "coordinates": [[18.643034, -33.808206], [18.602732, -33.800869], [18.544256, -33.83129]]}, "bbox": [18.544256, -33.83129, 18.643034, -33.800869]}, {"id": "45", "type": "Feature", "properties": {"feature_id": 46, "name": "Plumstead Stream", "waterway_type": "river"}, "geometry": {"type": "LineString", "coordinates": [[18.430603, -33.82948], [18.393556, -33.878997], [18.36191, -33.958531]]}, "bbox": [18.36191, -33.958531, 18.430603, -33.82948]}, {"id": "46", "type": "Feature", "properties": {"feature_id": 47, "name": "Camps Bay Stream", "waterway_type": "drain"}, "geometry": {"type": "LineString", "coordinates": [[18.358285, -33.955535], [18.379483, -34.018855], [18.421638, -34.078355]]}, "bbox": [18.358285, -34.078355, 18.421638, -33.955535]}, {"id": "47", "type": "Feature", "properties": {"feature_id": 48, "name": "Bokramspruit River", "waterway_type": "canal"}, "geometry": {"type": "LineString", "coordinates": [[18.533422, -34.076777], [18.581401, -34.09885], [18.634786, -34.086587]]}, "bbox": [18.533422, -34.09885, 18.634786, -34.076777]}, {"id": "48", "type": "Feature", "properties": {"feature_id": 49, "name": "Mosselbank Stream", "waterway_type": "ditch"}, "geometry": {"type": "LineString", "coordinates": [[18.696058, -34.0878], [18.699603, -34.049435], [18.684979, -33.97607]]}, "bbox": [18.684979, -34.0878, 18.699603, -33.97607]}, {"id": "49", "type": "Feature", "properties": {"feature_id": 50, "name": "Skoolspruit Stream", "waterway_type": "stream"}, "geometry": {"type": "LineString", "coordinates": [[18.604792, -33.979019], [18.558642, -33.913571], [18.497715, -33.842887]]}, "bbox": [18.497715, -33.979019, 18.604792, -33.842887]}, {"id": "50", "type": "Feature", "properties": {"feature_id": 51, "name": "Vergenoegd River", "waterway_type": "river"}, "geometry": {"type": "LineString", "coordinates": [[18.395091, -33.845009], [18.367746, -33.809378], [18.35095, -33.802829]]}, "bbox": [18.35095, -33.845009, 18.395091, -33.802829]}, {"id": "51", "type": "Feature", "properties": {"feature_id": 52, "name": "Liesbeek Stream", "waterway_type": "drain"}, "geometry": {"type": "LineString", "coordinates": [[18.378214, -33.802278], [18.410262, -33.827442], [18.462528, -33.890721]]}, "bbox": [18.378214, -33.890721, 18.462528, -33.802278]}, {"id": "52", "type": "Feature", "properties": {"feature_id": 53, "name": "Black River Stream", "waterway_type": "canal"}, "geometry": {"type": "LineString", "coordinates": [[18.579211, -33.887977], [18.623083, -33.952058], [18.666833, -34.03015]]}, "bbox": [18.579211, -34.03015, 18.666833, -33.887977]}, {"id": "53", "type": "Feature", "properties": {"feature_id": 54, "name": "Salt River", "waterway_type": "ditch"}, "geometry": {"type": "LineString", "coordinates": [[18.699743, -34.027599], [18.69032, -34.074885], [18.660616, -34.099897]]}, "bbox": [18.660616, -34.099897, 18.699743, -34.027599]}, {"id": "54", "type": "Feature", "properties": {"feature_id": 55, "name": "Diep Stream", "waterway_type": "stream"}, "geometry": {"type": "LineString", "coordinates": [[18.560904, -34.099756], [18.512172, -34.089136], [18.453104, -34.039323]]}, "bbox": [18.453104, -34.099756, 18.560904, -34.039323]}, {"id": "55", "type": "Feature", "properties": {"feature_id": 56, "name": "Eerste Stream", "waterway_type": "river"}, "geometry": {"type": "LineString", "coordinates": [[18.368772, -34.041715], [18.353065, -33.982423], [18.352308, -33.901092]]}, "bbox": [18.352308, -34.041715, 18.368772, -33.901092]}, {"id": "56", "type": "Feature", "properties": {"feature_id": 57, "name": "Lourens River", "waterway_type": "drain"}, "geometry": {"type": "LineString", "coordinates": [[18.40853, -33.903937], [18.449161, -33.847521], [18.507838, -33.805381]]}, "bbox": [18.40853, -33.903937, 18.507838, -33.805381]}, {"id": "57", "type": "Feature", "properties": {"feature_id": 58, "name": "Hout Bay Stream", "waterway_type": "canal"}, "geometry": {"type": "LineString", "coordinates": [[18.621164, -33.806206], [18.657825, -33.801714], [18.688842, -33.835403]]}, "bbox": [18.621164, -33.835403, 18.688842, -33.801714]}, {"id": "58", "type": "Feature", "properties": {"feature_id": 59, "name": "Disa Stream", "waterway_type": "ditch"}, "geometry": {"type": "LineString", "coordinates": [[18.691062, -33.83349], [18.669337, -33.884828], [18.626655, -33.965055]]}, "bbox": [18.626655, -33.965055, 18.691062, -33.83349]}, {"id": "59", "type": "Feature", "properties": {"feature_id": 60, "name": "Sand River", "waterway_type": "stream"}, "geometry": {"type": "LineString", "coordinates": [[18.514474, -33.962067], [18.466609, -34.024602], [18.413581, -34.081619]]}, "bbox": [18.413581, -34.081619, 18.514474, -33.962067]}, {"id": "60", "type": "Feature", "properties": {"feature_id": 61, "name": "Soet Stream", "waterway_type": "river"}, "geometry": {"type": "LineString", "coordinates": [[18.35351, -34.080153], [18.350551, -34.099517], [18.365886, -34.083753]]}, "bbox": [18.350551, -34.099517, 18.365886, -34.080153]}, {"id": "61", "type": "Feature", "properties": {"feature_id": 62, "name": "Klein Liesbeek Stream", "waterway_type": "drain"}, "geometry": {"type": "LineString", "coordinates": [[18.447088, -34.085084], [18.493427, -34.044442], [18.554364, -33.969602]]}, "bbox": [18.447088, -34.085084, 18.554364, -33.969602]}, {"id": "62", "type": "Feature", "properties": {"feature_id": 63, "name": "Kuils River", "waterway_type": "canal"}, "geometry": {"type": "LineString", "coordinates": [[18.656311, -33.972572], [18.683167, -33.907259], [18.699257, -33.838409]]}, "bbox": [18.656311, -33.972572, 18.699257, -33.838409]}, {"id": "63", "type": "Feature", "properties": {"feature_id": 64, "name": "Modder Stream", "waterway_type": "ditch"}, "geometry": {"type": "LineString", "coordinates": [[18.670629, -33.840436], [18.638139, -33.807235], [18.5855, -33.804233]]}, "bbox": [18.5855, -33.840436, 18.670629, -33.804233]}, {"id": "64", "type": "Feature", "properties": {"feature_id": 65, "name": "Princess Vlei Stream", "waterway_type": "stream"}, "geometry": {"type": "LineString", "coordinates": [[18.46879, -33.803555], [18.425179, -33.831331], [18.381943, -33.896787]]}, "bbox": [18.381943, -33.896787, 18.46879, -33.803555]}, {"id": "65", "type": "Feature", "properties": {"feature_id": 66, "name": "Riet River", "waterway_type": "river"}, "geometry": {"type": "LineString", "coordinates": [[18.350383, -33.893993], [18.360383, -33.958598], [18.390725, -34.035604]]}, "bbox": [18.350383, -34.035604, 18.390725, -33.893993]}, {"id": "66", "type": "Feature", "properties": {"feature_id": 67, "name": "Schaapen Stream", "waterway_type": "drain"}, "geometry": {"type": "LineString", "coordinates": [[18.491161, -34.033124], [18.539928, -34.07839], [18.598811, -34.099997]]}, "bbox": [18.491161, -34.099997, 18.598811, -34.033124]}, {"id": "67", "type": "Feature", "properties": {"feature_id": 68, "name": "Steenbras Stream", "waterway_type": "canal"}, "geometry": {"type": "LineString", "coordinates": [[18.682166, -34.099986], [18.697315, -34.08656], [18.697339, -34.033982]]}, "bbox": [18.682166, -34.099986, 18.697339, -34.033982]}, {"id": "68", "type": "Feature", "properties": {"feature_id": 69, "name": "Sir Lowry River", "waterway_type": "ditch"}, "geometry": {"type": "LineString", "coordinates": [[18.63989, -34.036451], [18.598935, -33.976004], [18.540064, -33.894953]]}, "bbox": [18.540064, -34.036451, 18.63989, -33.894953]}, {"id": "69", "type": "Feature", "properties": {"feature_id": 70, "name": "Constantia Stream", "waterway_type": "stream"}, "geometry": {"type": "LineString", "coordinates": [[18.427083, -33.897755], [18.390813, -33.842841], [18.360429, -33.803782]]}, "bbox": [18.360429, -33.897755, 18.427083, -33.803782]}, {"id": "70", "type": "Feature", "properties": {"feature_id": 71, "name": "Klipfontein Stream", "waterway_type": "river"}, "geometry": {"type": "LineString", "coordinates": [[18.359614, -33.804481], [18.381865, -33.802842], [18.425067, -33.839733]]}, "bbox": [18.359614, -33.839733, 18.425067, -33.802842]}, {"id": "71", "type": "Feature", "properties": {"feature_id": 72, "name": "Plumstead River", "waterway_type": "drain"}, "geometry": {"type": "LineString", "coordinates": [[18.537628, -33.837721], [18.585372, -33.890782], [18.638035, -33.97155]]}, "bbox": [18.537628, -33.97155, 18.638035, -33.837721]}, {"id": "72", "type": "Feature", "properties": {"feature_id": 73, "name": "Camps Bay Stream", "waterway_type": "canal"}, "geometry": {"type": "LineString", "coordinates": [[18.696898, -33.968577], [18.699269, -34.030207], [18.683225, -34.084631]]}, "bbox": [18.683225, -34.084631, 18.699269, -33.968577]}, {"id": "73", "type": "Feature", "properties": {"feature_id": 74, "name": "Bokramspruit Stream", "waterway_type": "ditch"}, "geometry": {"type": "LineString", "coordinates": [[18.60102, -34.083282], [18.554499, -34.099899], [18.493562, -34.080664]]}, "bbox": [18.493562, -34.099899, 18.60102, -34.080664]}, {"id": "74", "type": "Feature", "properties": {"feature_id": 75, "name": "Mosselbank River", "waterway_type": "stream"}, "geometry": {"type": "LineString", "coordinates": [[18.392306, -34.082111], [18.365943, -34.039269], [18.350562, -33.963097]]}, "bbox": [18.350562, -34.082111, 18.392306, -33.963097]}, {"id": "75", "type": "Feature", "properties": {"feature_id": 76, "name": "Skoolspruit Stream", "waterway_type": "river"}, "geometry": {"type": "LineString", "coordinates": [[18.38055, -33.966083], [18.413476, -33.901029], [18.466481, -33.834144]]}, "bbox": [18.38055, -33.966083, 18.466481, -33.834144]}, {"id": "76", "type": "Feature", "properties": {"feature_id": 77, "name": "Vergenoegd Stream", "waterway_type": "drain"}, "geometry": {"type": "LineString", "coordinates": [[18.583201, -33.836072], [18.626544, -33.805364], [18.669259, -33.805916]]}, "bbox": [18.583201, -33.836072, 18.669259, -33.805364]}, {"id": "77", "type": "Feature", "properties": {"feature_id": 78, "name": "Liesbeek River", "waterway_type": "canal"}, "geometry": {"type": "LineString", "coordinates": [[18.699465, -33.80511], [18.68889, -33.835446], [18.657914, -33.902955]]}, "bbox": [18.657914, -33.902955, 18.699465, -33.80511]}, {"id": "78", "type": "Feature", "properties": {"feature_id": 79, "name": "Black River Stream", "waterway_type": "ditch"}, "geometry": {"type": "LineString", "coordinates": [[18.55677, -33.900116], [18.507975, -33.965121], [18.449284, -34.040895]]}, "bbox": [18.449284, -34.040895, 18.55677, -33.900116]}, {"id": "79", "type": "Feature", "properties": {"feature_id": 80, "name": "Salt Stream", "waterway_type": "stream"}, "geometry": {"type": "LineString", "coordinates": [[18.366919, -34.03849], [18.35233, -34.081651], [18.353039, -34.099811]]}, "bbox": [18.35233, -34.099811, 18.366919, -34.03849]}, {"id": "80", "type": "Feature", "properties": {"feature_id": 81, "name": "Diep River", "waterway_type": "river"}, "geometry": {"type": "LineString", "coordinates": [[18.411707, -34.099932], [18.452979, -34.083723], [18.512036, -34.028481]]}, "bbox": [18.411707, -34.099932, 18.512036, -34.028481]}, {"id": "81", "type": "Feature", "properties": {"feature_id": 82, "name": "Eerste Stream", "waterway_type": "drain"}, "geometry": {"type": "LineString", "coordinates": [[18.624656, -34.031022], [18.660529, -33.969536], [18.690275, -33.88892]]}, "bbox": [18.624656, -34.031022, 18.690275, -33.88892]}, {"id": "82", "type": "Feature", "properties": {"feature_id": 83, "name": "Lourens Stream", "waterway_type": "canal"}, "geometry": {"type": "LineString", "coordinates": [[18.689685, -33.891672], [18.666913, -33.838365], [18.623197, -33.802461]]}, "bbox": [18.623197, -33.891672, 18.689685, -33.802461]}, {"id": "83", "type": "Feature", "properties": {"feature_id": 84, "name": "Hout Bay River", "waterway_type": "ditch"}, "geometry": {"type": "LineString", "coordinates": [[18.510272, -33.803032], [18.462655, -33.804249], [18.410365, -33.844273]]}, "bbox": [18.410365, -33.844273, 18.510272, -33.803032]}, {"id": "84", "type": "Feature", "properties": {"feature_id": 85, "name": "Disa Stream", "waterway_type": "stream"}, "geometry": {"type": "LineString", "coordinates": [[18.35272, -33.842166], [18.350936, -33.896849], [18.367686, -33.978004]]}, "bbox": [18.350936, -33.978004, 18.367686, -33.842166]}, {"id": "85", "type": "Feature", "properties": {"feature_id": 86, "name": "Sand Stream", "waterway_type": "river"}, "geometry": {"type": "LineString", "coordinates": [[18.450883, -33.975051], [18.49758, -34.035659], [18.558508, -34.087388]]}, "bbox": [18.450883, -34.087388, 18.558508, -33.975051]}, {"id": "86", "type": "Feature", "properties": {"feature_id": 87, "name": "Soet River", "waterway_type": "drain"}, "geometry": {"type": "LineString", "coordinates": [[18.659058, -34.086157], [18.684924, -34.099996], [18.699594, -34.077327]]}, "bbox": [18.659058, -34.099996, 18.699594, -34.077327]}, {"id": "87", "type": "Feature", "properties": {"feature_id": 88, "name": "Klein Liesbeek Stream", "waterway_type": "canal"}, "geometry": {"type": "LineString", "coordinates": [[18.668251, -34.078887], [18.634893, -34.033927], [18.58153, -33.956568]]}, "bbox": [18.58153, -34.078887, 18.668251, -33.956568]}, {"id": "88", "type": "Feature", "properties": {"feature_id": 89, "name": "Kuils Stream", "waterway_type": "ditch"}, "geometry": {"type": "LineString", "coordinates": [[18.464817, -33.959563], [18.421748, -33.894891], [18.379559, -33.830098]]}, "bbox": [18.379559, -33.959563, 18.464817, -33.830098]}, {"id": "89", "type": "Feature", "properties": {"feature_id": 90, "name": "Modder River", "waterway_type": "stream"}, "geometry": {"type": "LineString", "coordinates": [[18.350713, -33.831925], [18.36186, -33.803767], [18.393466, -33.807872]]}, "bbox": [18.350713, -33.831925, 18.393466, -33.803767]}, {"id": "90", "type": "Feature", "properties": {"feature_id": 91, "name": "Princess Vlei Stream", "waterway_type": "river"}, "geometry": {"type": "LineString", "coordinates": [[18.495303, -33.806941], [18.544121, -33.839778], [18.602609, -33.909212]]}, "bbox": [18.495303, -33.909212, 18.602609, -33.806941]}, {"id": "91", "type": "Feature", "properties": {"feature_id": 92, "name": "Riet Stream", "waterway_type": "drain"}, "geometry": {"type": "LineString", "coordinates": [[18.683973, -33.906333], [18.698, -33.971616], [18.696557, -34.046013]]}, "bbox": [18.683973, -34.046013, 18.698, -33.906333]}, {"id": "92", "type": "Feature", "properties": {"feature_id": 93, "name": "Schaapen River", "waterway_type": "canal"}, "geometry": {"type": "LineString", "coordinates": [[18.636679, -34.043689], [18.595096, -34.084661], [18.535863, -34.09934]]}, "bbox": [18.535863, -34.09934, 18.636679, -34.043689]}, {"id": "93", "type": "Feature", "properties": {"feature_id": 94, "name": "Steenbras Stream", "waterway_type": "ditch"}, "geometry": {"type": "LineString", "coordinates": [[18.42362, -34.099592], [18.388148, -34.080632], [18.359045, -34.022831]]}, "bbox": [18.359045, -34.099592, 18.42362, -34.022831]}, {"id": "94", "type": "Feature", "properties": {"feature_id": 95, "name": "Sir Lowry Stream", "waterway_type": "stream"}, "geometry": {"type": "LineString", "coordinates": [[18.361039, -34.025439], [18.38433, -33.963031], [18.428554, -33.883003]]}, "bbox": [18.361039, -34.025439, 18.428554, -33.883003]}, {"id": "95", "type": "Feature", "properties": {"feature_id": 96, "name": "Constantia River", "waterway_type": "river"}, "geometry": {"type": "LineString", "coordinates": [[18.541825, -33.8857], [18.589308, -33.834101], [18.641218, -33.801421]]}, "bbox": [18.541825, -33.8857, 18.641218, -33.801421]}, {"id": "96", "type": "Feature", "properties": {"feature_id": 97, "name": "Klipfontein Stream", "waterway_type": "drain"}, "geometry": {"type": "LineString", "coordinates": [[18.697637, -33.801863], [18.698834, -33.805934], [18.68138, -33.849015]]}, "bbox": [18.68138, -33.849015, 18.698834, -33.801863]}, {"id": "97", "type": "Feature", "properties": {"feature_id": 98, "name": "Plumstead Stream", "waterway_type": "canal"}, "geometry": {"type": "LineString", "coordinates": [[18.597204, -33.846817], [18.550338, -33.903018], [18.489427, -33.984405]]}, "bbox": [18.489427, -33.984405, 18.597204, -33.846817]}, {"id": "98", "type": "Feature", "properties": {"feature_id": 99, "name": "Camps Bay River", "waterway_type": "ditch"}, "geometry": {"type": "LineString", "coordinates": [[18.389598, -33.981478], [18.364233, -34.040948], [18.350275, -34.089883]]}, "bbox": [18.350275, -34.089883, 18.389598, -33.981478]}, {"id": "99", "type": "Feature", "properties": {"feature_id": 100, "name": "Bokramspruit Stream", "waterway_type": "stream"}, "geometry": {"type": "LineString", "coordinates": [[18.382969, -34.088772], [18.416754, -34.099808], [18.470467, -34.073747]]}, "bbox": [18.382969, -34.099808, 18.470467, -34.073747]}], "dropped_count": 20}
1:09