diff --git a/dataviz/tutorial_source/file_sf.geojson b/dataviz/tutorial_source/file_sf.geojson index 1de0db74..947e370b 100644 --- a/dataviz/tutorial_source/file_sf.geojson +++ b/dataviz/tutorial_source/file_sf.geojson @@ -1 +1,1285 @@ -{"type": "FeatureCollection", "features": [{"geometry": {"type": "Point", "coordinates": ["-122.424612993055", "37.8014488257836"]}, "type": "Feature", "id": 0, "properties": {"date": "02/18/2003", "description": "FORGERY, CREDIT CARD", "title": "FRAUD"}}, {"geometry": {"type": "Point", "coordinates": ["-122.420120319211", "37.7877570602182"]}, "type": "Feature", "id": 1, "properties": {"date": "04/17/2003", "description": "WARRANT ARREST", "title": "WARRANTS"}}, {"geometry": {"type": "Point", "coordinates": ["-122.42025048261", "37.7800745746105"]}, "type": "Feature", "id": 2, "properties": {"date": "02/18/2003", "description": "GRAND THEFT PICKPOCKET", "title": "LARCENY/THEFT"}}, {"geometry": {"type": "Point", "coordinates": ["-122.390718076188", "37.7385560584619"]}, "type": "Feature", "id": 3, "properties": {"date": "02/18/2003", "description": "SALE OF BASE/ROCK COCAINE", "title": "DRUG/NARCOTIC"}}, {"geometry": {"type": "Point", "coordinates": ["-122.390718076188", "37.7385560584619"]}, "type": "Feature", "id": 4, "properties": {"date": "02/18/2003", "description": "CONSPIRACY", "title": "OTHER OFFENSES"}}, {"geometry": {"type": "Point", "coordinates": ["-122.390718076188", "37.7385560584619"]}, "type": "Feature", "id": 5, "properties": {"date": "02/18/2003", "description": "PROBATION VIOLATION", "title": "OTHER OFFENSES"}}, {"geometry": {"type": "Point", "coordinates": ["-122.433084166809", "37.7851499161314"]}, "type": "Feature", "id": 6, "properties": {"date": "03/31/2003", "description": "UNDER INFLUENCE OF ALCOHOL IN A PUBLIC PLACE", "title": "DRUNKENNESS"}}, {"geometry": {"type": "Point", "coordinates": ["-122.433084166809", "37.7851499161314"]}, "type": "Feature", "id": 7, "properties": {"date": "03/31/2003", "description": "WARRANT ARREST", "title": "WARRANTS"}}, {"geometry": {"type": "Point", "coordinates": ["-122.422727873548", "37.7503729275448"]}, "type": "Feature", "id": 8, "properties": {"date": "02/22/2003", "description": "WARRANT ARREST", "title": "WARRANTS"}}, {"geometry": {"type": "Point", "coordinates": ["-122.403675174069", "37.7751775072045"]}, "type": "Feature", "id": 9, "properties": {"date": "04/01/2003", "description": "WARRANT ARREST", "title": "WARRANTS"}}, {"geometry": {"type": "Point", "coordinates": ["-122.411451390903", "37.7831610223684"]}, "type": "Feature", "id": 10, "properties": {"date": "04/16/2003", "description": "WARRANT ARREST", "title": "WARRANTS"}}, {"geometry": {"type": "Point", "coordinates": ["-122.403675174069", "37.7751775072045"]}, "type": "Feature", "id": 13, "properties": {"date": "03/06/2003", "description": "WARRANT ARREST", "title": "WARRANTS"}}, {"geometry": {"type": "Point", "coordinates": ["-122.38396343886", "37.7299972589437"]}, "type": "Feature", "id": 14, "properties": {"date": "03/28/2003", "description": "WARRANT ARREST", "title": "WARRANTS"}}, {"geometry": {"type": "Point", "coordinates": ["-122.403675174069", "37.7751775072045"]}, "type": "Feature", "id": 15, "properties": {"date": "03/18/2003", "description": "WARRANT ARREST", "title": "WARRANTS"}}, {"geometry": {"type": "Point", "coordinates": ["-122.418216140593", "37.7832571722888"]}, "type": "Feature", "id": 16, "properties": {"date": "06/29/2003", "description": "POSSESSION OF BASE/ROCK COCAINE", "title": "DRUG/NARCOTIC"}}, {"geometry": {"type": "Point", "coordinates": ["-122.418216140593", "37.7832571722888"]}, "type": "Feature", "id": 17, "properties": {"date": "06/29/2003", "description": "VISITING WHERE DRUGS ARE USED OR SMOKED", "title": "DRUG/NARCOTIC"}}, {"geometry": {"type": "Point", "coordinates": ["-122.418216140593", "37.7832571722888"]}, "type": "Feature", "id": 18, "properties": {"date": "06/29/2003", "description": "CONSPIRACY", "title": "OTHER OFFENSES"}}, {"geometry": {"type": "Point", "coordinates": ["-122.403675174069", "37.7751775072045"]}, "type": "Feature", "id": 19, "properties": {"date": "05/19/2003", "description": "WARRANT ARREST", "title": "WARRANTS"}}, {"geometry": {"type": "Point", "coordinates": ["-122.420899861106", "37.7830998598518"]}, "type": "Feature", "id": 20, "properties": {"date": "04/29/2003", "description": "WARRANT ARREST", "title": "WARRANTS"}}, {"geometry": {"type": "Point", "coordinates": ["-122.403742963163", "37.7752317022311"]}, "type": "Feature", "id": 21, "properties": {"date": "07/09/2003", "description": "ATTEMPTED RAPE, BODILY FORCE", "title": "SEX OFFENSES, FORCIBLE"}}, {"geometry": {"type": "Point", "coordinates": ["-122.403742963163", "37.7752317022311"]}, "type": "Feature", "id": 22, "properties": {"date": "07/09/2003", "description": "SEXUAL BATTERY", "title": "SEX OFFENSES, FORCIBLE"}}, {"geometry": {"type": "Point", "coordinates": ["-122.403742963163", "37.7752317022311"]}, "type": "Feature", "id": 23, "properties": {"date": "07/09/2003", "description": "FALSE IMPRISONMENT", "title": "KIDNAPPING"}}, {"geometry": {"type": "Point", "coordinates": ["-122.390718076188", "37.7385560584619"]}, "type": "Feature", "id": 25, "properties": {"date": "02/18/2003", "description": "WARRANT ARREST", "title": "WARRANTS"}}, {"geometry": {"type": "Point", "coordinates": ["-122.410499480261", "37.7709080121265"]}, "type": "Feature", "id": 26, "properties": {"date": "02/18/2003", "description": "PETTY THEFT SHOPLIFTING", "title": "LARCENY/THEFT"}}, {"geometry": {"type": "Point", "coordinates": ["-122.413954401004", "37.7837266691432"]}, "type": "Feature", "id": 27, "properties": {"date": "05/06/2003", "description": "WARRANT ARREST", "title": "WARRANTS"}}, {"geometry": {"type": "Point", "coordinates": ["-122.41076876635", "37.7832145189783"]}, "type": "Feature", "id": 28, "properties": {"date": "01/01/2003", "description": "WARRANT ARREST", "title": "WARRANTS"}}, {"geometry": {"type": "Point", "coordinates": ["-122.464399080209", "37.7142937891548"]}, "type": "Feature", "id": 29, "properties": {"date": "04/11/2003", "description": "WARRANT ARREST", "title": "WARRANTS"}}, {"geometry": {"type": "Point", "coordinates": ["-122.418975990673", "37.7822802427689"]}, "type": "Feature", "id": 30, "properties": {"date": "02/11/2003", "description": "LOST PROPERTY", "title": "NON-CRIMINAL"}}, {"geometry": {"type": "Point", "coordinates": ["-122.476076157719", "37.7798003502211"]}, "type": "Feature", "id": 31, "properties": {"date": "02/15/2003", "description": "SUSPICIOUS OCCURRENCE", "title": "SUSPICIOUS OCC"}}, {"geometry": {"type": "Point", "coordinates": ["-122.406736227461", "37.7793521642061"]}, "type": "Feature", "id": 32, "properties": {"date": "02/19/2003", "description": "WARRANT ARREST", "title": "WARRANTS"}}, {"geometry": {"type": "Point", "coordinates": ["-122.440990149758", "37.7280912993572"]}, "type": "Feature", "id": 33, "properties": {"date": "02/27/2003", "description": "WARRANT ARREST", "title": "WARRANTS"}}, {"geometry": {"type": "Point", "coordinates": ["-122.440486731269", "37.717089261011"]}, "type": "Feature", "id": 34, "properties": {"date": "02/18/2003", "description": "CHECKS, FORGERY (FELONY)", "title": "FORGERY/COUNTERFEITING"}}, {"geometry": {"type": "Point", "coordinates": ["-122.407810337041", "37.7873789357712"]}, "type": "Feature", "id": 35, "properties": {"date": "03/07/2003", "description": "BURGLARY OF STORE, UNLAWFUL ENTRY", "title": "BURGLARY"}}, {"geometry": {"type": "Point", "coordinates": ["-122.452192036764", "37.7456678660441"]}, "type": "Feature", "id": 36, "properties": {"date": "04/10/2003", "description": "BATTERY", "title": "ASSAULT"}}, {"geometry": {"type": "Point", "coordinates": ["-122.392096198043", "37.7346106238966"]}, "type": "Feature", "id": 38, "properties": {"date": "06/11/2003", "description": "FOUND PROPERTY", "title": "NON-CRIMINAL"}}, {"geometry": {"type": "Point", "coordinates": ["-122.468567046618", "37.7218120474233"]}, "type": "Feature", "id": 39, "properties": {"date": "03/05/2003", "description": "WARRANT ARREST", "title": "WARRANTS"}}, {"geometry": {"type": "Point", "coordinates": ["-122.413430143292", "37.7809244840289"]}, "type": "Feature", "id": 40, "properties": {"date": "05/09/2003", "description": "WARRANT ARREST", "title": "WARRANTS"}}, {"geometry": {"type": "Point", "coordinates": ["-122.41474383539", "37.7787192627661"]}, "type": "Feature", "id": 41, "properties": {"date": "01/11/2003", "description": "WARRANT ARREST", "title": "WARRANTS"}}, {"geometry": {"type": "Point", "coordinates": ["-122.411985603895", "37.7850007126251"]}, "type": "Feature", "id": 42, "properties": {"date": "02/27/2003", "description": "WARRANT ARREST", "title": "WARRANTS"}}, {"geometry": {"type": "Point", "coordinates": ["-122.415916307497", "37.7835460531365"]}, "type": "Feature", "id": 43, "properties": {"date": "04/01/2003", "description": "WARRANT ARREST", "title": "WARRANTS"}}, {"geometry": {"type": "Point", "coordinates": ["-122.430150533574", "37.7237516945755"]}, "type": "Feature", "id": 44, "properties": {"date": "01/07/2003", "description": "WARRANT ARREST", "title": "WARRANTS"}}, {"geometry": {"type": "Point", "coordinates": ["-122.452898067361", "37.7803623690592"]}, "type": "Feature", "id": 45, "properties": {"date": "02/17/2003", "description": "PETTY THEFT AUTO STRIP", "title": "LARCENY/THEFT"}}, {"geometry": {"type": "Point", "coordinates": ["-122.406292154396", "37.7969378530276"]}, "type": "Feature", "id": 46, "properties": {"date": "04/01/2003", "description": "WARRANT ARREST", "title": "WARRANTS"}}, {"geometry": {"type": "Point", "coordinates": ["-122.417146843843", "37.7814463501111"]}, "type": "Feature", "id": 47, "properties": {"date": "03/13/2003", "description": "WARRANT ARREST", "title": "WARRANTS"}}, {"geometry": {"type": "Point", "coordinates": ["-122.410120385828", "37.7832742526736"]}, "type": "Feature", "id": 51, "properties": {"date": "01/30/2003", "description": "WARRANT ARREST", "title": "WARRANTS"}}, {"geometry": {"type": "Point", "coordinates": ["-122.41076876635", "37.7832145189783"]}, "type": "Feature", "id": 52, "properties": {"date": "04/16/2003", "description": "WARRANT ARREST", "title": "WARRANTS"}}, {"geometry": {"type": "Point", "coordinates": ["-122.403675174069", "37.7751775072045"]}, "type": "Feature", "id": 53, "properties": {"date": "01/27/2003", "description": "WARRANT ARREST", "title": "WARRANTS"}}, {"geometry": {"type": "Point", "coordinates": ["-122.463649337975", "37.7810158001278"]}, "type": "Feature", "id": 54, "properties": {"date": "02/06/2003", "description": "VEHICLE, RECOVERED, AUTO", "title": "VEHICLE THEFT"}}, {"geometry": {"type": "Point", "coordinates": ["-122.454416646218", "37.7738144424117"]}, "type": "Feature", "id": 55, "properties": {"date": "03/31/2003", "description": "VEHICLE, RECOVERED, AUTO", "title": "VEHICLE THEFT"}}, {"geometry": {"type": "Point", "coordinates": ["-122.401128911522", "37.7416238982259"]}, "type": "Feature", "id": 56, "properties": {"date": "02/26/2003", "description": "VEHICLE, RECOVERED, OTHER VEHICLE", "title": "VEHICLE THEFT"}}, {"geometry": {"type": "Point", "coordinates": ["-122.472321912644", "37.7216221726592"]}, "type": "Feature", "id": 58, "properties": {"date": "01/06/2003", "description": "STOLEN MOTORCYCLE", "title": "VEHICLE THEFT"}}, {"geometry": {"type": "Point", "coordinates": ["-122.472321912644", "37.7216221726592"]}, "type": "Feature", "id": 59, "properties": {"date": "01/06/2003", "description": "VEHICLE, RECOVERED, MOTORCYCLE", "title": "VEHICLE THEFT"}}, {"geometry": {"type": "Point", "coordinates": ["-122.472321912644", "37.7216221726592"]}, "type": "Feature", "id": 60, "properties": {"date": "01/06/2003", "description": "DRIVERS LICENSE, SUSPENDED OR REVOKED", "title": "OTHER OFFENSES"}}, {"geometry": {"type": "Point", "coordinates": ["-122.423875745902", "37.7815322022236"]}, "type": "Feature", "id": 61, "properties": {"date": "02/18/2003", "description": "POSSESSION OF MARIJUANA", "title": "DRUG/NARCOTIC"}}, {"geometry": {"type": "Point", "coordinates": ["-122.414283516807", "37.7798026426118"]}, "type": "Feature", "id": 64, "properties": {"date": "04/16/2003", "description": "VEHICLE, RECOVERED, OTHER VEHICLE", "title": "VEHICLE THEFT"}}, {"geometry": {"type": "Point", "coordinates": ["-122.439031526151", "37.792834644197"]}, "type": "Feature", "id": 66, "properties": {"date": "02/19/2003", "description": "VEHICLE, RECOVERED, OTHER VEHICLE", "title": "VEHICLE THEFT"}}, {"geometry": {"type": "Point", "coordinates": ["-122.41860417617", "37.7645406474689"]}, "type": "Feature", "id": 70, "properties": {"date": "06/15/2003", "description": "WARRANT ARREST", "title": "WARRANTS"}}, {"geometry": {"type": "Point", "coordinates": ["-122.417482152738", "37.7432053428649"]}, "type": "Feature", "id": 72, "properties": {"date": "01/01/2003", "description": "VEHICLE, RECOVERED, OTHER VEHICLE", "title": "VEHICLE THEFT"}}, {"geometry": {"type": "Point", "coordinates": ["-122.447204008446", "37.7823643146491"]}, "type": "Feature", "id": 73, "properties": {"date": "02/18/2003", "description": "BURGLARY OF STORE, UNLAWFUL ENTRY", "title": "BURGLARY"}}, {"geometry": {"type": "Point", "coordinates": ["-122.400213058516", "37.781219757735"]}, "type": "Feature", "id": 74, "properties": {"date": "01/07/2003", "description": "VEHICLE, RECOVERED, OTHER VEHICLE", "title": "VEHICLE THEFT"}}, {"geometry": {"type": "Point", "coordinates": ["-122.447204008446", "37.7823643146491"]}, "type": "Feature", "id": 75, "properties": {"date": "02/18/2003", "description": "PETTY THEFT WITH PRIOR", "title": "LARCENY/THEFT"}}, {"geometry": {"type": "Point", "coordinates": ["-122.395062849871", "37.7665443562126"]}, "type": "Feature", "id": 76, "properties": {"date": "02/18/2003", "description": "DRIVERS LICENSE, SUSPENDED OR REVOKED", "title": "OTHER OFFENSES"}}, {"geometry": {"type": "Point", "coordinates": ["-122.403742963163", "37.7752317022311"]}, "type": "Feature", "id": 77, "properties": {"date": "02/18/2003", "description": "LOST PROPERTY", "title": "NON-CRIMINAL"}}, {"geometry": {"type": "Point", "coordinates": ["-122.412121608458", "37.7813786406361"]}, "type": "Feature", "id": 80, "properties": {"date": "02/18/2003", "description": "POSSESSION OF MARIJUANA", "title": "DRUG/NARCOTIC"}}, {"geometry": {"type": "Point", "coordinates": ["-122.412928651741", "37.7108440493915"]}, "type": "Feature", "id": 81, "properties": {"date": "01/05/2003", "description": "VEHICLE, RECOVERED, OTHER VEHICLE", "title": "VEHICLE THEFT"}}, {"geometry": {"type": "Point", "coordinates": ["-122.412227135355", "37.7732376715687"]}, "type": "Feature", "id": 82, "properties": {"date": "02/19/2003", "description": "LOST PROPERTY", "title": "NON-CRIMINAL"}}, {"geometry": {"type": "Point", "coordinates": ["-122.407669499424", "37.7985117160826"]}, "type": "Feature", "id": 83, "properties": {"date": "02/17/2003", "description": "FALSE PRETENSES, GRAND THEFT", "title": "FRAUD"}}, {"geometry": {"type": "Point", "coordinates": ["-122.416396849194", "37.7941810635756"]}, "type": "Feature", "id": 84, "properties": {"date": "01/28/2003", "description": "VEHICLE, RECOVERED, MOTORCYCLE", "title": "VEHICLE THEFT"}}, {"geometry": {"type": "Point", "coordinates": ["-122.424412715072", "37.7680054163869"]}, "type": "Feature", "id": 86, "properties": {"date": "02/18/2003", "description": "GRAND THEFT FROM LOCKED AUTO", "title": "LARCENY/THEFT"}}, {"geometry": {"type": "Point", "coordinates": ["-122.40668477101", "37.7810106825623"]}, "type": "Feature", "id": 87, "properties": {"date": "02/19/2003", "description": "BATTERY OF A POLICE OFFICER", "title": "ASSAULT"}}, {"geometry": {"type": "Point", "coordinates": ["-122.40668477101", "37.7810106825623"]}, "type": "Feature", "id": 88, "properties": {"date": "02/19/2003", "description": "POSSESSION OF BASE/ROCK COCAINE", "title": "DRUG/NARCOTIC"}}, {"geometry": {"type": "Point", "coordinates": ["-122.424246473478", "37.7748122523492"]}, "type": "Feature", "id": 89, "properties": {"date": "02/18/2003", "description": "PETTY THEFT FROM LOCKED AUTO", "title": "LARCENY/THEFT"}}, {"geometry": {"type": "Point", "coordinates": ["-122.399860692395", "37.7905089709634"]}, "type": "Feature", "id": 90, "properties": {"date": "02/19/2003", "description": "TRESPASSING", "title": "TRESPASS"}}, {"geometry": {"type": "Point", "coordinates": ["-122.411042446829", "37.7297148186521"]}, "type": "Feature", "id": 91, "properties": {"date": "02/19/2003", "description": "GRAND THEFT FROM LOCKED AUTO", "title": "LARCENY/THEFT"}}, {"geometry": {"type": "Point", "coordinates": ["-122.412121608458", "37.7813786406361"]}, "type": "Feature", "id": 92, "properties": {"date": "02/18/2003", "description": "SALE OF MARIJUANA", "title": "DRUG/NARCOTIC"}}, {"geometry": {"type": "Point", "coordinates": ["-122.412471875496", "37.7348960836964"]}, "type": "Feature", "id": 93, "properties": {"date": "02/18/2003", "description": "MISSING JUVENILE", "title": "MISSING PERSON"}}, {"geometry": {"type": "Point", "coordinates": ["-122.472529445752", "37.7171858507749"]}, "type": "Feature", "id": 94, "properties": {"date": "01/13/2003", "description": "MALICIOUS MISCHIEF, GRAFFITI", "title": "VANDALISM"}}, {"geometry": {"type": "Point", "coordinates": ["-122.412471875496", "37.7348960836964"]}, "type": "Feature", "id": 96, "properties": {"date": "02/18/2003", "description": "FOUND PERSON", "title": "MISSING PERSON"}}, {"geometry": {"type": "Point", "coordinates": ["-122.407069627873", "37.7981847618287"]}, "type": "Feature", "id": 97, "properties": {"date": "02/18/2003", "description": "BATTERY", "title": "ASSAULT"}}, {"geometry": {"type": "Point", "coordinates": ["-122.445006858202", "37.7773636900243"]}, "type": "Feature", "id": 98, "properties": {"date": "02/18/2003", "description": "OBSCENE PHONE CALLS(S)", "title": "OTHER OFFENSES"}}]} \ No newline at end of file +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "id": "0", + "properties": { + "title": "FRAUD", + "description": "FORGERY, CREDIT CARD", + "date": "02/18/2003" + }, + "geometry": { + "type": "Point", + "coordinates": [ + "-122.424612993055", + "37.8014488257836" + ] + } + }, + { + "type": "Feature", + "id": "1", + "properties": { + "title": "WARRANTS", + "description": "WARRANT ARREST", + "date": "04/17/2003" + }, + "geometry": { + "type": "Point", + "coordinates": [ + "-122.420120319211", + "37.7877570602182" + ] + } + }, + { + "type": "Feature", + "id": "2", + "properties": { + "title": "LARCENY/THEFT", + "description": "GRAND THEFT PICKPOCKET", + "date": "02/18/2003" + }, + "geometry": { + "type": "Point", + "coordinates": [ + "-122.42025048261", + "37.7800745746105" + ] + } + }, + { + "type": "Feature", + "id": "3", + "properties": { + "title": "DRUG/NARCOTIC", + "description": "SALE OF BASE/ROCK COCAINE", + "date": "02/18/2003" + }, + "geometry": { + "type": "Point", + "coordinates": [ + "-122.390718076188", + "37.7385560584619" + ] + } + }, + { + "type": "Feature", + "id": "4", + "properties": { + "title": "OTHER OFFENSES", + "description": "CONSPIRACY", + "date": "02/18/2003" + }, + "geometry": { + "type": "Point", + "coordinates": [ + "-122.390718076188", + "37.7385560584619" + ] + } + }, + { + "type": "Feature", + "id": "5", + "properties": { + "title": "OTHER OFFENSES", + "description": "PROBATION VIOLATION", + "date": "02/18/2003" + }, + "geometry": { + "type": "Point", + "coordinates": [ + "-122.390718076188", + "37.7385560584619" + ] + } + }, + { + "type": "Feature", + "id": "6", + "properties": { + "title": "DRUNKENNESS", + "description": "UNDER INFLUENCE OF ALCOHOL IN A PUBLIC PLACE", + "date": "03/31/2003" + }, + "geometry": { + "type": "Point", + "coordinates": [ + "-122.433084166809", + "37.7851499161314" + ] + } + }, + { + "type": "Feature", + "id": "7", + "properties": { + "title": "WARRANTS", + "description": "WARRANT ARREST", + "date": "03/31/2003" + }, + "geometry": { + "type": "Point", + "coordinates": [ + "-122.433084166809", + "37.7851499161314" + ] + } + }, + { + "type": "Feature", + "id": "8", + "properties": { + "title": "WARRANTS", + "description": "WARRANT ARREST", + "date": "02/22/2003" + }, + "geometry": { + "type": "Point", + "coordinates": [ + "-122.422727873548", + "37.7503729275448" + ] + } + }, + { + "type": "Feature", + "id": "9", + "properties": { + "title": "WARRANTS", + "description": "WARRANT ARREST", + "date": "04/01/2003" + }, + "geometry": { + "type": "Point", + "coordinates": [ + "-122.403675174069", + "37.7751775072045" + ] + } + }, + { + "type": "Feature", + "id": "10", + "properties": { + "title": "WARRANTS", + "description": "WARRANT ARREST", + "date": "04/16/2003" + }, + "geometry": { + "type": "Point", + "coordinates": [ + "-122.411451390903", + "37.7831610223684" + ] + } + }, + { + "type": "Feature", + "id": "13", + "properties": { + "title": "WARRANTS", + "description": "WARRANT ARREST", + "date": "03/06/2003" + }, + "geometry": { + "type": "Point", + "coordinates": [ + "-122.403675174069", + "37.7751775072045" + ] + } + }, + { + "type": "Feature", + "id": "14", + "properties": { + "title": "WARRANTS", + "description": "WARRANT ARREST", + "date": "03/28/2003" + }, + "geometry": { + "type": "Point", + "coordinates": [ + "-122.38396343886", + "37.7299972589437" + ] + } + }, + { + "type": "Feature", + "id": "15", + "properties": { + "title": "WARRANTS", + "description": "WARRANT ARREST", + "date": "03/18/2003" + }, + "geometry": { + "type": "Point", + "coordinates": [ + "-122.403675174069", + "37.7751775072045" + ] + } + }, + { + "type": "Feature", + "id": "16", + "properties": { + "title": "DRUG/NARCOTIC", + "description": "POSSESSION OF BASE/ROCK COCAINE", + "date": "06/29/2003" + }, + "geometry": { + "type": "Point", + "coordinates": [ + "-122.418216140593", + "37.7832571722888" + ] + } + }, + { + "type": "Feature", + "id": "17", + "properties": { + "title": "DRUG/NARCOTIC", + "description": "VISITING WHERE DRUGS ARE USED OR SMOKED", + "date": "06/29/2003" + }, + "geometry": { + "type": "Point", + "coordinates": [ + "-122.418216140593", + "37.7832571722888" + ] + } + }, + { + "type": "Feature", + "id": "18", + "properties": { + "title": "OTHER OFFENSES", + "description": "CONSPIRACY", + "date": "06/29/2003" + }, + "geometry": { + "type": "Point", + "coordinates": [ + "-122.418216140593", + "37.7832571722888" + ] + } + }, + { + "type": "Feature", + "id": "19", + "properties": { + "title": "WARRANTS", + "description": "WARRANT ARREST", + "date": "05/19/2003" + }, + "geometry": { + "type": "Point", + "coordinates": [ + "-122.403675174069", + "37.7751775072045" + ] + } + }, + { + "type": "Feature", + "id": "20", + "properties": { + "title": "WARRANTS", + "description": "WARRANT ARREST", + "date": "04/29/2003" + }, + "geometry": { + "type": "Point", + "coordinates": [ + "-122.420899861106", + "37.7830998598518" + ] + } + }, + { + "type": "Feature", + "id": "21", + "properties": { + "title": "SEX OFFENSES, FORCIBLE", + "description": "ATTEMPTED RAPE, BODILY FORCE", + "date": "07/09/2003" + }, + "geometry": { + "type": "Point", + "coordinates": [ + "-122.403742963163", + "37.7752317022311" + ] + } + }, + { + "type": "Feature", + "id": "22", + "properties": { + "title": "SEX OFFENSES, FORCIBLE", + "description": "SEXUAL BATTERY", + "date": "07/09/2003" + }, + "geometry": { + "type": "Point", + "coordinates": [ + "-122.403742963163", + "37.7752317022311" + ] + } + }, + { + "type": "Feature", + "id": "23", + "properties": { + "title": "KIDNAPPING", + "description": "FALSE IMPRISONMENT", + "date": "07/09/2003" + }, + "geometry": { + "type": "Point", + "coordinates": [ + "-122.403742963163", + "37.7752317022311" + ] + } + }, + { + "type": "Feature", + "id": "25", + "properties": { + "title": "WARRANTS", + "description": "WARRANT ARREST", + "date": "02/18/2003" + }, + "geometry": { + "type": "Point", + "coordinates": [ + "-122.390718076188", + "37.7385560584619" + ] + } + }, + { + "type": "Feature", + "id": "26", + "properties": { + "title": "LARCENY/THEFT", + "description": "PETTY THEFT SHOPLIFTING", + "date": "02/18/2003" + }, + "geometry": { + "type": "Point", + "coordinates": [ + "-122.410499480261", + "37.7709080121265" + ] + } + }, + { + "type": "Feature", + "id": "27", + "properties": { + "title": "WARRANTS", + "description": "WARRANT ARREST", + "date": "05/06/2003" + }, + "geometry": { + "type": "Point", + "coordinates": [ + "-122.413954401004", + "37.7837266691432" + ] + } + }, + { + "type": "Feature", + "id": "28", + "properties": { + "title": "WARRANTS", + "description": "WARRANT ARREST", + "date": "01/01/2003" + }, + "geometry": { + "type": "Point", + "coordinates": [ + "-122.41076876635", + "37.7832145189783" + ] + } + }, + { + "type": "Feature", + "id": "29", + "properties": { + "title": "WARRANTS", + "description": "WARRANT ARREST", + "date": "04/11/2003" + }, + "geometry": { + "type": "Point", + "coordinates": [ + "-122.464399080209", + "37.7142937891548" + ] + } + }, + { + "type": "Feature", + "id": "30", + "properties": { + "title": "NON-CRIMINAL", + "description": "LOST PROPERTY", + "date": "02/11/2003" + }, + "geometry": { + "type": "Point", + "coordinates": [ + "-122.418975990673", + "37.7822802427689" + ] + } + }, + { + "type": "Feature", + "id": "31", + "properties": { + "title": "SUSPICIOUS OCC", + "description": "SUSPICIOUS OCCURRENCE", + "date": "02/15/2003" + }, + "geometry": { + "type": "Point", + "coordinates": [ + "-122.476076157719", + "37.7798003502211" + ] + } + }, + { + "type": "Feature", + "id": "32", + "properties": { + "title": "WARRANTS", + "description": "WARRANT ARREST", + "date": "02/19/2003" + }, + "geometry": { + "type": "Point", + "coordinates": [ + "-122.406736227461", + "37.7793521642061" + ] + } + }, + { + "type": "Feature", + "id": "33", + "properties": { + "title": "WARRANTS", + "description": "WARRANT ARREST", + "date": "02/27/2003" + }, + "geometry": { + "type": "Point", + "coordinates": [ + "-122.440990149758", + "37.7280912993572" + ] + } + }, + { + "type": "Feature", + "id": "34", + "properties": { + "title": "FORGERY/COUNTERFEITING", + "description": "CHECKS, FORGERY (FELONY)", + "date": "02/18/2003" + }, + "geometry": { + "type": "Point", + "coordinates": [ + "-122.440486731269", + "37.717089261011" + ] + } + }, + { + "type": "Feature", + "id": "35", + "properties": { + "title": "BURGLARY", + "description": "BURGLARY OF STORE, UNLAWFUL ENTRY", + "date": "03/07/2003" + }, + "geometry": { + "type": "Point", + "coordinates": [ + "-122.407810337041", + "37.7873789357712" + ] + } + }, + { + "type": "Feature", + "id": "36", + "properties": { + "title": "ASSAULT", + "description": "BATTERY", + "date": "04/10/2003" + }, + "geometry": { + "type": "Point", + "coordinates": [ + "-122.452192036764", + "37.7456678660441" + ] + } + }, + { + "type": "Feature", + "id": "38", + "properties": { + "title": "NON-CRIMINAL", + "description": "FOUND PROPERTY", + "date": "06/11/2003" + }, + "geometry": { + "type": "Point", + "coordinates": [ + "-122.392096198043", + "37.7346106238966" + ] + } + }, + { + "type": "Feature", + "id": "39", + "properties": { + "title": "WARRANTS", + "description": "WARRANT ARREST", + "date": "03/05/2003" + }, + "geometry": { + "type": "Point", + "coordinates": [ + "-122.468567046618", + "37.7218120474233" + ] + } + }, + { + "type": "Feature", + "id": "40", + "properties": { + "title": "WARRANTS", + "description": "WARRANT ARREST", + "date": "05/09/2003" + }, + "geometry": { + "type": "Point", + "coordinates": [ + "-122.413430143292", + "37.7809244840289" + ] + } + }, + { + "type": "Feature", + "id": "41", + "properties": { + "title": "WARRANTS", + "description": "WARRANT ARREST", + "date": "01/11/2003" + }, + "geometry": { + "type": "Point", + "coordinates": [ + "-122.41474383539", + "37.7787192627661" + ] + } + }, + { + "type": "Feature", + "id": "42", + "properties": { + "title": "WARRANTS", + "description": "WARRANT ARREST", + "date": "02/27/2003" + }, + "geometry": { + "type": "Point", + "coordinates": [ + "-122.411985603895", + "37.7850007126251" + ] + } + }, + { + "type": "Feature", + "id": "43", + "properties": { + "title": "WARRANTS", + "description": "WARRANT ARREST", + "date": "04/01/2003" + }, + "geometry": { + "type": "Point", + "coordinates": [ + "-122.415916307497", + "37.7835460531365" + ] + } + }, + { + "type": "Feature", + "id": "44", + "properties": { + "title": "WARRANTS", + "description": "WARRANT ARREST", + "date": "01/07/2003" + }, + "geometry": { + "type": "Point", + "coordinates": [ + "-122.430150533574", + "37.7237516945755" + ] + } + }, + { + "type": "Feature", + "id": "45", + "properties": { + "title": "LARCENY/THEFT", + "description": "PETTY THEFT AUTO STRIP", + "date": "02/17/2003" + }, + "geometry": { + "type": "Point", + "coordinates": [ + "-122.452898067361", + "37.7803623690592" + ] + } + }, + { + "type": "Feature", + "id": "46", + "properties": { + "title": "WARRANTS", + "description": "WARRANT ARREST", + "date": "04/01/2003" + }, + "geometry": { + "type": "Point", + "coordinates": [ + "-122.406292154396", + "37.7969378530276" + ] + } + }, + { + "type": "Feature", + "id": "47", + "properties": { + "title": "WARRANTS", + "description": "WARRANT ARREST", + "date": "03/13/2003" + }, + "geometry": { + "type": "Point", + "coordinates": [ + "-122.417146843843", + "37.7814463501111" + ] + } + }, + { + "type": "Feature", + "id": "51", + "properties": { + "title": "WARRANTS", + "description": "WARRANT ARREST", + "date": "01/30/2003" + }, + "geometry": { + "type": "Point", + "coordinates": [ + "-122.410120385828", + "37.7832742526736" + ] + } + }, + { + "type": "Feature", + "id": "52", + "properties": { + "title": "WARRANTS", + "description": "WARRANT ARREST", + "date": "04/16/2003" + }, + "geometry": { + "type": "Point", + "coordinates": [ + "-122.41076876635", + "37.7832145189783" + ] + } + }, + { + "type": "Feature", + "id": "53", + "properties": { + "title": "WARRANTS", + "description": "WARRANT ARREST", + "date": "01/27/2003" + }, + "geometry": { + "type": "Point", + "coordinates": [ + "-122.403675174069", + "37.7751775072045" + ] + } + }, + { + "type": "Feature", + "id": "54", + "properties": { + "title": "VEHICLE THEFT", + "description": "VEHICLE, RECOVERED, AUTO", + "date": "02/06/2003" + }, + "geometry": { + "type": "Point", + "coordinates": [ + "-122.463649337975", + "37.7810158001278" + ] + } + }, + { + "type": "Feature", + "id": "55", + "properties": { + "title": "VEHICLE THEFT", + "description": "VEHICLE, RECOVERED, AUTO", + "date": "03/31/2003" + }, + "geometry": { + "type": "Point", + "coordinates": [ + "-122.454416646218", + "37.7738144424117" + ] + } + }, + { + "type": "Feature", + "id": "56", + "properties": { + "title": "VEHICLE THEFT", + "description": "VEHICLE, RECOVERED, OTHER VEHICLE", + "date": "02/26/2003" + }, + "geometry": { + "type": "Point", + "coordinates": [ + "-122.401128911522", + "37.7416238982259" + ] + } + }, + { + "type": "Feature", + "id": "58", + "properties": { + "title": "VEHICLE THEFT", + "description": "STOLEN MOTORCYCLE", + "date": "01/06/2003" + }, + "geometry": { + "type": "Point", + "coordinates": [ + "-122.472321912644", + "37.7216221726592" + ] + } + }, + { + "type": "Feature", + "id": "59", + "properties": { + "title": "VEHICLE THEFT", + "description": "VEHICLE, RECOVERED, MOTORCYCLE", + "date": "01/06/2003" + }, + "geometry": { + "type": "Point", + "coordinates": [ + "-122.472321912644", + "37.7216221726592" + ] + } + }, + { + "type": "Feature", + "id": "60", + "properties": { + "title": "OTHER OFFENSES", + "description": "DRIVERS LICENSE, SUSPENDED OR REVOKED", + "date": "01/06/2003" + }, + "geometry": { + "type": "Point", + "coordinates": [ + "-122.472321912644", + "37.7216221726592" + ] + } + }, + { + "type": "Feature", + "id": "61", + "properties": { + "title": "DRUG/NARCOTIC", + "description": "POSSESSION OF MARIJUANA", + "date": "02/18/2003" + }, + "geometry": { + "type": "Point", + "coordinates": [ + "-122.423875745902", + "37.7815322022236" + ] + } + }, + { + "type": "Feature", + "id": "64", + "properties": { + "title": "VEHICLE THEFT", + "description": "VEHICLE, RECOVERED, OTHER VEHICLE", + "date": "04/16/2003" + }, + "geometry": { + "type": "Point", + "coordinates": [ + "-122.414283516807", + "37.7798026426118" + ] + } + }, + { + "type": "Feature", + "id": "66", + "properties": { + "title": "VEHICLE THEFT", + "description": "VEHICLE, RECOVERED, OTHER VEHICLE", + "date": "02/19/2003" + }, + "geometry": { + "type": "Point", + "coordinates": [ + "-122.439031526151", + "37.792834644197" + ] + } + }, + { + "type": "Feature", + "id": "70", + "properties": { + "title": "WARRANTS", + "description": "WARRANT ARREST", + "date": "06/15/2003" + }, + "geometry": { + "type": "Point", + "coordinates": [ + "-122.41860417617", + "37.7645406474689" + ] + } + }, + { + "type": "Feature", + "id": "72", + "properties": { + "title": "VEHICLE THEFT", + "description": "VEHICLE, RECOVERED, OTHER VEHICLE", + "date": "01/01/2003" + }, + "geometry": { + "type": "Point", + "coordinates": [ + "-122.417482152738", + "37.7432053428649" + ] + } + }, + { + "type": "Feature", + "id": "73", + "properties": { + "title": "BURGLARY", + "description": "BURGLARY OF STORE, UNLAWFUL ENTRY", + "date": "02/18/2003" + }, + "geometry": { + "type": "Point", + "coordinates": [ + "-122.447204008446", + "37.7823643146491" + ] + } + }, + { + "type": "Feature", + "id": "74", + "properties": { + "title": "VEHICLE THEFT", + "description": "VEHICLE, RECOVERED, OTHER VEHICLE", + "date": "01/07/2003" + }, + "geometry": { + "type": "Point", + "coordinates": [ + "-122.400213058516", + "37.781219757735" + ] + } + }, + { + "type": "Feature", + "id": "75", + "properties": { + "title": "LARCENY/THEFT", + "description": "PETTY THEFT WITH PRIOR", + "date": "02/18/2003" + }, + "geometry": { + "type": "Point", + "coordinates": [ + "-122.447204008446", + "37.7823643146491" + ] + } + }, + { + "type": "Feature", + "id": "76", + "properties": { + "title": "OTHER OFFENSES", + "description": "DRIVERS LICENSE, SUSPENDED OR REVOKED", + "date": "02/18/2003" + }, + "geometry": { + "type": "Point", + "coordinates": [ + "-122.395062849871", + "37.7665443562126" + ] + } + }, + { + "type": "Feature", + "id": "77", + "properties": { + "title": "NON-CRIMINAL", + "description": "LOST PROPERTY", + "date": "02/18/2003" + }, + "geometry": { + "type": "Point", + "coordinates": [ + "-122.403742963163", + "37.7752317022311" + ] + } + }, + { + "type": "Feature", + "id": "80", + "properties": { + "title": "DRUG/NARCOTIC", + "description": "POSSESSION OF MARIJUANA", + "date": "02/18/2003" + }, + "geometry": { + "type": "Point", + "coordinates": [ + "-122.412121608458", + "37.7813786406361" + ] + } + }, + { + "type": "Feature", + "id": "81", + "properties": { + "title": "VEHICLE THEFT", + "description": "VEHICLE, RECOVERED, OTHER VEHICLE", + "date": "01/05/2003" + }, + "geometry": { + "type": "Point", + "coordinates": [ + "-122.412928651741", + "37.7108440493915" + ] + } + }, + { + "type": "Feature", + "id": "82", + "properties": { + "title": "NON-CRIMINAL", + "description": "LOST PROPERTY", + "date": "02/19/2003" + }, + "geometry": { + "type": "Point", + "coordinates": [ + "-122.412227135355", + "37.7732376715687" + ] + } + }, + { + "type": "Feature", + "id": "83", + "properties": { + "title": "FRAUD", + "description": "FALSE PRETENSES, GRAND THEFT", + "date": "02/17/2003" + }, + "geometry": { + "type": "Point", + "coordinates": [ + "-122.407669499424", + "37.7985117160826" + ] + } + }, + { + "type": "Feature", + "id": "84", + "properties": { + "title": "VEHICLE THEFT", + "description": "VEHICLE, RECOVERED, MOTORCYCLE", + "date": "01/28/2003" + }, + "geometry": { + "type": "Point", + "coordinates": [ + "-122.416396849194", + "37.7941810635756" + ] + } + }, + { + "type": "Feature", + "id": "86", + "properties": { + "title": "LARCENY/THEFT", + "description": "GRAND THEFT FROM LOCKED AUTO", + "date": "02/18/2003" + }, + "geometry": { + "type": "Point", + "coordinates": [ + "-122.424412715072", + "37.7680054163869" + ] + } + }, + { + "type": "Feature", + "id": "87", + "properties": { + "title": "ASSAULT", + "description": "BATTERY OF A POLICE OFFICER", + "date": "02/19/2003" + }, + "geometry": { + "type": "Point", + "coordinates": [ + "-122.40668477101", + "37.7810106825623" + ] + } + }, + { + "type": "Feature", + "id": "88", + "properties": { + "title": "DRUG/NARCOTIC", + "description": "POSSESSION OF BASE/ROCK COCAINE", + "date": "02/19/2003" + }, + "geometry": { + "type": "Point", + "coordinates": [ + "-122.40668477101", + "37.7810106825623" + ] + } + }, + { + "type": "Feature", + "id": "89", + "properties": { + "title": "LARCENY/THEFT", + "description": "PETTY THEFT FROM LOCKED AUTO", + "date": "02/18/2003" + }, + "geometry": { + "type": "Point", + "coordinates": [ + "-122.424246473478", + "37.7748122523492" + ] + } + }, + { + "type": "Feature", + "id": "90", + "properties": { + "title": "TRESPASS", + "description": "TRESPASSING", + "date": "02/19/2003" + }, + "geometry": { + "type": "Point", + "coordinates": [ + "-122.399860692395", + "37.7905089709634" + ] + } + }, + { + "type": "Feature", + "id": "91", + "properties": { + "title": "LARCENY/THEFT", + "description": "GRAND THEFT FROM LOCKED AUTO", + "date": "02/19/2003" + }, + "geometry": { + "type": "Point", + "coordinates": [ + "-122.411042446829", + "37.7297148186521" + ] + } + }, + { + "type": "Feature", + "id": "92", + "properties": { + "title": "DRUG/NARCOTIC", + "description": "SALE OF MARIJUANA", + "date": "02/18/2003" + }, + "geometry": { + "type": "Point", + "coordinates": [ + "-122.412121608458", + "37.7813786406361" + ] + } + }, + { + "type": "Feature", + "id": "93", + "properties": { + "title": "MISSING PERSON", + "description": "MISSING JUVENILE", + "date": "02/18/2003" + }, + "geometry": { + "type": "Point", + "coordinates": [ + "-122.412471875496", + "37.7348960836964" + ] + } + }, + { + "type": "Feature", + "id": "94", + "properties": { + "title": "VANDALISM", + "description": "MALICIOUS MISCHIEF, GRAFFITI", + "date": "01/13/2003" + }, + "geometry": { + "type": "Point", + "coordinates": [ + "-122.472529445752", + "37.7171858507749" + ] + } + }, + { + "type": "Feature", + "id": "96", + "properties": { + "title": "MISSING PERSON", + "description": "FOUND PERSON", + "date": "02/18/2003" + }, + "geometry": { + "type": "Point", + "coordinates": [ + "-122.412471875496", + "37.7348960836964" + ] + } + }, + { + "type": "Feature", + "id": "97", + "properties": { + "title": "ASSAULT", + "description": "BATTERY", + "date": "02/18/2003" + }, + "geometry": { + "type": "Point", + "coordinates": [ + "-122.407069627873", + "37.7981847618287" + ] + } + }, + { + "type": "Feature", + "id": "98", + "properties": { + "title": "OTHER OFFENSES", + "description": "OBSCENE PHONE CALLS(S)", + "date": "02/18/2003" + }, + "geometry": { + "type": "Point", + "coordinates": [ + "-122.445006858202", + "37.7773636900243" + ] + } + } + ] +} \ No newline at end of file diff --git a/dataviz/tutorial_source/map.py b/dataviz/tutorial_source/map.py index 114eecaa..d4869f5a 100644 --- a/dataviz/tutorial_source/map.py +++ b/dataviz/tutorial_source/map.py @@ -46,7 +46,7 @@ def create_map(data_file): # Assign line items to appropriate GeoJSON fields. data['type'] = 'Feature' - data['id'] = index + data['id'] = str(index) data['properties'] = {'title': line['Category'], 'description': line['Descript'], 'date': line['Date']} @@ -66,7 +66,7 @@ def create_map(data_file): # Now that all data is parsed in GeoJSON write to a file so we # can upload it to gist.github.com with open('file_sf.geojson', 'w') as f: - f.write(geojson.dumps(geo_map)) + geojson.dump(geo_map, f, indent=6) def main(): diff --git a/dataviz/tutorial_source/parse.py b/dataviz/tutorial_source/parse.py index 1a757db0..187af0e7 100644 --- a/dataviz/tutorial_source/parse.py +++ b/dataviz/tutorial_source/parse.py @@ -31,7 +31,7 @@ def parse(raw_file, delimiter): parsed_data = [] # Skip over the first line of the file for the headers - fields = csv_data.next() + fields = next(csv_data) # Iterate over each row of the csv file, zip together field -> value for row in csv_data: @@ -48,7 +48,7 @@ def main(): new_data = parse(MY_FILE, ",") # Let's see what the data looks like! - print new_data + print(new_data) if __name__ == "__main__":