How/Where do I get geoJSON data for states, provinces, and administrative regions of non-US countries? [closed]

This process is now simplified (July 2014) compared to the steps I see in the accepted answer. It now seems much easier to get this data. I at first floundered around the web hoping I could just download a bunch of standard maps in GeoJSON format, but came up empty other than standard US/Canada offerings. … Read more

Need the path for particular files using os.walk() [duplicate]

os.walk gives you the path to the directory as the first value in the loop, just use os.path.join() to create full filename: shpfiles = [] for dirpath, subdirs, files in os.walk(path): for x in files: if x.endswith(“.shp”): shpfiles.append(os.path.join(dirpath, x)) I renamed path in the loop to dirpath to not conflict with the path variable you … Read more

Does anyone know of a library in Java that can parse ESRI Shapefiles?

GeoTools will do it. There are a ton of jars and you don’t need most of them. However, reading the shapefile is just a few lines. File file = new File(“mayshapefile.shp”); try { Map<String, String> connect = new HashMap(); connect.put(“url”, file.toURI().toString()); DataStore dataStore = DataStoreFinder.getDataStore(connect); String[] typeNames = dataStore.getTypeNames(); String typeName = typeNames[0]; System.out.println(“Reading content … Read more

Best way to overlay an ESRI shapefile on google maps?

I like using (open source and gui friendly) Quantum GIS to convert the shapefile to kml. Google Maps API supports only a subset of the KML standard. One limitation is file size. To reduce your file size, you can Quantum GIS’s “simplify geometries” function. This “smooths” polygons. Then you can select your layer and do … Read more