Locating GPS locations using GeoJSON - geolocation

I've got a GeoJSON file of administrative borders i.e. state and county, and a CSV file with 12,500+ named GPS coordinates located within the geographic area.
My boss wants me to use the GeoJSON identify the county for each GPS location so I ended up with a CSV file (format) like;
LOCNAME, LOCLONG, LOCLAT, COUNTY, STATE
Is there any tool that can do this?
Thanks a bunch.

You may use QGIS to do this. You may import your geojson polygon file and import the csv containing coordinates as a point layer.
Follow the tutorial here: http://www.qgistutorials.com/en/docs/points_in_polygon.html

Related

Swift: getting user location based on geoJSON

Given a geoJSON representation of each US state (such as found here), along with user location coordinates (as available via CLLocationManager), what would be the best way to identify which state is the user in? What is the standard way to parse the geoJSON file, and simply identify which polygons contain the user location?
Let's say my location is in Indiana. I'm looking to create a function that parses the geoJSON representing the US, and identify that the user location only falls within the boundaries of Indiana coordinates.
Any suggestions/tips here is appreciated.

Find if a point (latitude, longitude) is within OpenStreetMaps "way" (area)

I have a list of longitude and latitude points for various houses, offices, etc. I am trying to split them up to determine if they are inside a certain Way or not. I don't want to use the old "centre point" of an area and then radius value as that is not accurate enough.
So for example if I had 4 locations in an Way like "Richmond Upon Thames" that looks like this:
It should return just point B and C. Is this possible using Open Street Maps API?
If you like Java, you could load the way as a Polygon and use the JTS (Java Topology Suite) library, or the AWT library to compute whether your points are inside or not.
Here is an example of how the Atlas library uses a combination of both in that specific case. For you it would look like this:
Convert each latitude/longitude pair of the Way to a Location object
Add each Location to a List and create a new Polygon with it
Call the Polygon.fullyGeometricallyEncloses(Location) method on that Polygon with each of the points of interest you have
The Atlas library is available in Maven Central for you to download.

What format is the coordinate of this geojson example

I have this geojson for bike paths and I can't seem to figure out what the coordinates represents. I was expecting longitude and latitude, but those doesn't seem to be it.
Here is an example:
"geometry":{
"type":"LineString",
"coordinates":[
[
305049.6192401955,
5061761.891977313
],
[
305038.71863293805,
5061778.694289856
]
]
}
The source of data can be found here : bike path data
Unfortunately, it is only in french, but the data is under geojson section then click on "Explorer/Aller a la ressource"
Any help is appreciated,
Cheers,
Your data uses this spatial reference system: EPSG:2950, also known as: "NAD83(CSRS) / MTM zone 8". The units in this system is meters.
This information can be found at the top of your geojson file here:
"name": "urn:ogc:def:crs:EPSG::2950"
The crs stands for coordinate reference system (And for the trivia value, EPSG stands for "European Petroleum Survey Group").
This is likely confirmed by the shapefile from the same data source (based on your link), the .prj file states:
PROJCS["Ontario_MTM_Zone_8_east_of_75_degrees_W_NAD_83_datum"
The MTM refers to Modified Transverse Mercator. If you want to easily convert this data (unproject it essentially) to WGS84 to get longitude latitude pairs, you could download the shapefile, unzip it, and add all files to mapshaper.org, open the console and enter proj wgs84 and then export as a geosjon (or topojson).

Get additional info for Zillow Neighborhood Boundaries

I am trying to use Neighborhood boundaries data(shape files) provide by Zillow.
files available at - http://www.zillow.com/howto/api/neighborhood-boundaries.htm
I am able to read the provided .dbf files but it just have information about state, county, city, name, and region ID.
can some one please guide me to get latitude longitudes or polygon information from this .dbf files or even from shape files.
also how to read the provided shape files?
Use the GetRegionChildren API to get the Lat/Long and other details corresponding to a regionId.

British National Grid Shapefile - convert to WGS84 Lat/Lon

I have a set of ESRI shapefiles which, I'm told, have been written using the British National Grid coordinate system. I need to convert these files to WGS84 lat/lons, for onward conversion to KML files. I'm having trouble doing this as follows:
If I open each of the original files in MapInfo Professional telling it that my file has a projection which is British National Grid then I can't see any geographic objects in the file; the map window is completely empty.
If I use MapInfo Professional's Universal Translator to convert the files to a WGS84 MapInfo TAB file then, just as before, the converted file won't display any geographic objects, the MapInfo window is empty.
Can I verify the coordinate system of these files? Am I missing anything here? Should I be able to convert the shapefiles in the way I'm expecting to be able to and view them using MapInfo Professional? Will another tool do a better job for me?
Thanks.
More Info:
My shapefile has coordinates which don't seem to translate to lat/lon properly and I'm now wondering if the coordinates aren't actually British National Grid. I'm seeing coordinates such as 383702523, 399081141 which appears to be approximately lat/lon 53.488182, -2.247153. Have you any idea what projection system my input file is in?
OS grid doesn't use WGS84 - it uses Airy 1936 (OSGB36) spheroid
So you need to go from OSgrid -> lat/lon then OSGB36->WGS84.
See http://www.ordnancesurvey.co.uk/oswebsite/gps/docs/convertingcoordinatesEN.pdf
To do OS grid to lat-lon see http://www.movable-type.co.uk/scripts/latlong-gridref.html
Then to go from OSGB36 -> WGS84 see http://www.movable-type.co.uk/scripts/latlong-convert-coords.html
http://gothos.info/2009/04/14/transform-projections-with-gdal-ogr/
ogr2ogr is a great tool for doing these sorts of conversions. You would run it with a command like
ogr2ogr -t_srs EPSG:4326 map_wgs84.shp map_original.shp
-t_srs is the option to transform co-ordinate systems. 4326 is the EPSG SRID for WGS84.

Resources