0

I want all hotel list in that polygon, so I am using the Google Place API to fetch hotel info. But Google Place gives only 60 records limit, so thought to get all lat long with 1 km distance in that polygon, so I can search Google Place with 1 km, and I will get all results.

Solution I tried:

  1. Create polygon in google earth and download KML file
  2. Convert it into GeoJSON file
  3. Now I have polygon lat long co-ordinates
  4. Now I want to draw grid of lat long with distance of 1 KM in same polygon.

I want above yellow lat long which are separated with 1 km in that polygon Need list of Lat long as below yellow dot.

enter image description here

My data

 {
"type": "FeatureCollection",
"name": "Test",
"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } },
"features": [
{ "type": "Feature", "properties": { "Name": "Test", "description": null }, "geometry": { "type": "Polygon", "coordinates": 
[ [ [ 76.95921132064926, 28.462199988668662 ], [ 76.963367015913107, 28.454396340060121 ], [ 76.96406171244611, 28.448923074655479 ],
 [ 76.979506480632438, 28.4628132424059 ], [ 76.968779231398202, 28.469906308302541 ], [ 76.961281573952363, 28.472337211248551 ],
 [ 76.95921132064926, 28.462199988668662 ] ] ] } }
]
}
5
  • I am a little confused about what you are trying to achieve, and what the question is. Where do you want to draw your points? Why did you convert to GeoJSON. Please edit the question to add more details
    – nmtoken
    Commented Aug 7, 2020 at 7:47
  • I want all hotel list in that polygon...so i am using google place api to fetch hotel info but google place gives only 60 records , so thought to get all lat long with 1 km distance in that polygon ,so i can search google place .with 1 km ..i will get all result Commented Aug 7, 2020 at 8:01
  • I don't know how to do this in Google Earth Engine, but the term for that kind of grid is "fishnet". Commented Aug 7, 2020 at 12:08
  • i dont want it in Google earth engine...just need is their any way in python or other language. to create grid lat long list using that polygon data Commented Aug 7, 2020 at 13:09
  • I'm working on a similar project, and I wanted to know if caching the hotel name data with the lat/longs went against the google places API policy
    – mimiasmith
    Commented Sep 21, 2021 at 7:03

1 Answer 1

1

In QGIS, load your KML polygon layer, no need to convert to GeoJSON first. Then go to Vector > Research Tools > Regular points take the extent from your layer, choose an output CRS which uses metres, say EPSG:3857, and select your spacing (to match your grid you'd want 500m), you can choose to write a file or just create a temporary layer, and run.

Creates the grid

500m grid

Then export your grid as CSV (I chose WKT format for geometry) using EPSG:4326, gives:

WKT,id
"POINT (76.9592113206492 28.4723372112485)",0
"POINT (76.9637028970698 28.4723372112485)",1
"POINT (76.9681944734904 28.4723372112485)",2
"POINT (76.972686049911 28.4723372112485)",3
"POINT (76.9771776263316 28.4723372112485)",4
"POINT (76.9592113206492 28.4683888289614)",5
"POINT (76.9637028970698 28.4683888289614)",6
"POINT (76.9681944734904 28.4683888289614)",7
"POINT (76.972686049911 28.4683888289614)",8
"POINT (76.9771776263316 28.4683888289614)",9
"POINT (76.9592113206492 28.4644402991291)",10
"POINT (76.9637028970698 28.4644402991291)",11
"POINT (76.9681944734904 28.4644402991291)",12
"POINT (76.972686049911 28.4644402991291)",13
"POINT (76.9771776263316 28.4644402991291)",14
"POINT (76.9592113206492 28.4604916217651)",15
"POINT (76.9637028970698 28.4604916217651)",16
"POINT (76.9681944734904 28.4604916217651)",17
"POINT (76.972686049911 28.4604916217651)",18
"POINT (76.9771776263316 28.4604916217651)",19
"POINT (76.9592113206492 28.4565427968824)",20
"POINT (76.9637028970698 28.4565427968824)",21
"POINT (76.9681944734904 28.4565427968824)",22
"POINT (76.972686049911 28.4565427968824)",23
"POINT (76.9771776263316 28.4565427968824)",24
"POINT (76.9592113206492 28.4525938244943)",25
"POINT (76.9637028970698 28.4525938244943)",26
"POINT (76.9681944734904 28.4525938244943)",27
"POINT (76.972686049911 28.4525938244943)",28
"POINT (76.9771776263316 28.4525938244943)",29
1
  • This is exactly i want , Thank you very very much @nmtoken for sharing your valuable knowledge and giving very detail explanation Commented Aug 10, 2020 at 18:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.