1

In order to add markers in map, I need geo coordinates of upazilas (upazila offices) in Bangladesh. Something like this GitHub repo bangladesh-geo should do my job, but unfortunately the SQL tables have longitude and latitude of districts only, not of upazilas (i.e., sub-districts).

Does the Internet have such a database? Or can anyone help me write a script pull coordinates in CSV, JSON, etc. format?

1

Wikidata contains upazilas' coordinates from Wikipedias and GeoNames:

SELECT ?divisionLabel ?districtLabel ?upazilaLabel ?upazila ?lat ?long ?fromLabel {
  ?upazila wdt:P31 wd:Q620471.
  ?upazila wdt:P131 ?district . ?district wdt:P31 wd:Q152732.
  ?district wdt:P131 ?division . ?division wdt:P31 wd:Q878040.
  OPTIONAL {
    ?upazila p:P625 ?statement. 
    ?statement psv:P625 [wikibase:geoLatitude ?lat; wikibase:geoLongitude ?long]
    OPTIONAL {
      ?statement prov:wasDerivedFrom [pr:P143|pr:P248 ?from] 
    }
  }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
} ORDER BY ?divisionLabel ?districtLabel ?upazilaLabel

Try it!


For some upazilas, Wikidata contains coordinates from several sources. The query returns pair of coordinates from all sources. Ask on SO, if you need only one pair of coordinates in that case.

P.S. I don't know, whether these points are upazila offices, or upazila centroids, or something else...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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