# Importing and and manipulating large GEOJSON files based on geographic locations

I have large GeoJson data files that I would like to import (i.e. buildings in a city, see image below for data structure) and then "cut out" only the buildings that are within approx. 100 GeoDisks (each of a 300m radius).

Importing the data takes a very long time, so I would like to save as much time by directly "filtering" out the specific buildings at the start - I would like to be able to run my other calculations a little more quickly.

At the moment I have filtered out the buildings by getting the centerpoint of each building first; and then using either RegionMember[] or GeoWithinQ[], but both calculations are very slow. The first using pure geometry, and the second using GeoData.

Is there a way to speed up GeoJson Data calculations ? This would be a great help! I am analysing the different types of buildings that are in a close radius to schools for a college project; to see "what schools are made of", and to then "guess" where news schools could be built.

Thanks a bunch !

• Hi Naomi, welcome to the Mathematica Stack Exchange. I'm quite experienced with GIS and with OpenStreetMaps data and I have to say, I'd highly recommend spinning up a local PostGIS DB and using osm2pgsql, and then query via SQL, rather than using any other data format. You might save yourself a lot of headaches :) – Carl Lange Jan 27 at 21:57
• How are you doing the RegionMember calculation? Things can generally be done much faster if you first calculate a single RegionMemberFunction and then apply that to your data. – b3m2a1 Jan 27 at 22:22
• Thanks for your quick answers! @b3m2a1 I was using a simple RegionMember like so: <Flatten@Position[ParallelMap[RegionMember[Polygon[findcoordinates[schoolMapDisk,-1]], #]&,buildingCenters],True]> I have tried RegionMemberFunction with a smaller data set; and it is already much faster! – Naomi Jan 28 at 10:15
• @Carl I will try using the RegionMemberFunction first; as I'm not sure how to go about using PostGIS DB; but if it fails I will try this. Thanks a lot for the pointer! – Naomi Jan 28 at 10:15