Nodejs function to query geojson polygons by long/lat (closed)
New here? Learn about Bountify and follow @bountify to get notified of new bounties! x

I need a nodejs function POC that we can query a long/lat to and it will return if it matches a polygon in a geojson file. The geojson today has about 570 polygons, scale wise this wont need to go over 600 or so in the near term. Meaning i dont expect this POC to support something like 5K

Here is a link to the raw file.

The goal of the output would be to do the following. Does it match a polygon yes or no. And if yes. Try to output the property info about it like

it seems like some polygons have different properties so maybe for that we just output what it has vs trying to force it to a structure.

I see the response/outcome being something like

  long: ...,
  lat: ..
  query_time: time in ms
  result: [
      inZone: true | false,
      properties__ADDRESS1: ...

We structure it like this in the event there are more than 1 match coming back.

Ideally the bounty can be developed in so we can have the geojson file local to the solution. My assumption is that when its run that nodejs would load the file to memory and create some sort of index and then the query would run against that. Subsequent queries would not need to load it to memory again. I might be thinking about this wrong so I am open to ideas. The ui for this would just be 2 html fields for long/lat input. The output can be a text area below the inputs where you dump out the outcome.

I will award 2 winners for this bounty.

first place at $100 to update previous solution code with updated requirements

hey guys one of the known devs from the previous gig is going to work on this.please dont spend time on it

I started looking for some help for geospatial queries in js/node and found these... maybe its helpful - dont feel like its required. I just dont want to go the mongodb route -
Qdev 5 months ago
Hello Qdev, I believe this is something I already did in the previous task ( Did this solution not work for you? I'll work on a solution with the UI.
radosinsky 5 months ago
Geez. so what if we do this. I will award you 100 winner here if you can just update your last solution for the updated requirements and data presented in this one? I also made sure to award that one... I think of my team posted so it... its a bit redundant but lets move forward assuming your code here.
Qdev 5 months ago
I updated the description above to reflect this approach...
Qdev 5 months ago
awarded to radosinsky

Crowdsource coding tasks.

1 Solution

Winning solution

I've finished the work we agreed on in the comments.