GeoJSON is a standardized format for representing geographic data in JSON. There’s a lot of great tooling out there for visualizing GeoJSON data. And GeoJSON is good for more than just storing points: it can represent points, lines, polygons, and collections.


A GeoJSON point looks like this:

  "type": "Point",
  "coordinates": [-80.1347334, 25.7663562]

This point represents a park in Miami Beach, FL. One easy way to visualize this point on a map is using

It is important to note that coordinates is in the format [lng, lat]. Longitude comes before latitude in GeoJSON. That is because longitude represents east-west position (x axis on a typical map), and latitude represents north-south position (y axis on a typical map), and the authors of the GeoJSON spec wanted to keep x, y coordinate order.

A common use case for GeoJSON points is geocoding: converting an address like “429 Lenox Ave, Miami Beach, FL” to latitude and longitude coordinates. For example, suppose you use the Mapbox geocoding API. You would make an HTTP request to the below endpoint:

And get the below result:

{"type":"FeatureCollection","query":["429","lenox","ave","miami"],"features":[{"id":"address.8052276751051244","type":"Feature","place_type":["address"],"relevance":1,"properties":{"accuracy":"rooftop"},"text":"Lenox Avenue","place_name":"429 Lenox Avenue, Miami Beach, Florida 33139, United States","center":[-80.139145,25.77409],"geometry":{"type":"Point","coordinates":[-80.139145,25.77409]}, ...}

If you look closely, features[0].geometry in the above JSON output is a GeoJSON Point:


#node #javascript #web-development #programming #developer

A Introduction to GeoJSON with Node.js
2.05 GEEK