geojson

MongoDB version 2.6 still fails on 2dsphere geoindexing citing inability to extract geokeys and possible malformed geometry

半腔热情 提交于 2019-12-11 07:22:56
问题 I had been getting the referenced error under version 2.4 with a different lon/lat data set. I upgraded to 2.6 and was able to use 2dsphere index on that data set. However, with a different data set (excerpt below) I received the old error message on trying to index using 2dshpere. the error message excerpt is as follows: I am having the same problem receiving the error: can't extract geokeys from object; malformed geometry?. The object is the following, which validated on on GeoJSONLint.com.

iOS Swift3 - Convert coordinate

 ̄綄美尐妖づ 提交于 2019-12-11 07:19:38
问题 I'm trying to create annotations on the MapKit from a geoJSON file, but the problem is that the coordinates provided by the geoJSON file don't match the coordinate system that MapKit uses. Question : How do I convert read the geoJSON file and convert the coordinates from `` to WGS84S ? Here is an example of what the geoJSON file looks like: {"name":"MAPADDRESSPOINT","type":"FeatureCollection" ,"crs":{"type":"name","properties":{"name":"EPSG:3008"}} ,"features":[ {"type":"Feature","geometry":{

Computing the center of gravity of a geoJSON Polygon using jq

假如想象 提交于 2019-12-11 06:21:28
问题 I have a list of cities described by their polygon in geoJSON files. I would like to get a sample inside point of the polygon. Basic maths says the center of gravity is inside the polygon and it suffices to sum all longitudes and all latitudes together then divide it by the number of points. Full file to process (visualization is available on GitHub) { "type": "FeatureCollection", "features": [ { "type": "Feature", "geometry": { "type": "Polygon", "coordinates": [[[2.41101, 48.72605], [2

Ambiguity about $geoNear in aggregate query

廉价感情. 提交于 2019-12-11 06:09:15
问题 I'm setting up a location based project where I'm working with GeoJSON. I've used $geoNear and I'm pretty familiar with it. Now I've reached a situation where I need to check from a list of documents that whether they fall in the maxDistance or not. And the challenge here is maxDistance is not predefined. It varies from document to document and being stored in the document. This is something like every store to be shown up in the map that is setup by the user to be informed when the user is

how to load geometryCollection of geojson file in d3

回眸只為那壹抹淺笑 提交于 2019-12-11 03:57:53
问题 I successfully converted a UK map shapefile to geojson using mapshapers. But I am unable to load this geojson in d3.js. Please help. script is as follows. <script src="http://d3js.org/d3.v3.min.js"></script> <script> var canvas = d3.select("body").append("svg") .attr("width", 760) .attr("height", 700) d3.json("Areas_uk_geo.json", function (data) { var group = canvas.selectAll("g") .data(data.geometries) .enter() .append("g"); var projection = d3.geo.mercator(); var path = d3.geo.path

d3.js: why is d3.geo.path() giving NaN?

不羁的心 提交于 2019-12-11 03:33:10
问题 I am trying to do some online mapping with d3, but running into a problem when I try to plot a line between two points. I have calculated the centroid of two polygons (source and target) In the code: var projection = d3.geo.mercator() .scale(width) .translate([0, 0]); var path = d3.geo.path() .projection(projection); From the JS console: > path({type: "LineString", coordinates: [path.centroid(source_country), path.centroid(target_country)]}); "M277.05056877663407,121.67976219138909L-694

Android Google Maps GeoJsonLayer OnFeatureClickListener, multiple layers

岁酱吖の 提交于 2019-12-10 21:08:40
问题 Please look at my code to create layer from geojson string and add layer to map: private GeoJsonLayer createLayerFromGeojson(String json) { JSONObject ob = null; try { ob = new JSONObject(json); } catch (JSONException e) { e.printStackTrace(); } GeoJsonLayer layer = new GeoJsonLayer(googleMap, ob); layer.addLayerToMap(); layer.setOnFeatureClickListener(feature -> Utils.showMessage(getActivity(), "Clicked", feature.getProperty("description").toString())); return layer; } Next add 2 layers to

Python folium GeoJSON map not displaying

爱⌒轻易说出口 提交于 2019-12-10 17:44:05
问题 Good afternoon, I'm trying to use a combination of geopandas, pandas and folium to create a polygon map that I can embed incorporate into a web page. For some reason, it's not displaying and wonder if anyone can help. The steps I've taken: 1) Grabbed a .shp from the UK's OS for Parliamentary boundaries. 2) I've then used geopandas to change the projection to epsg=4326 and then exported as GeoJSON which takes the following format: { "type": "Feature", "properties": { "PCON13CD": "E14000532",

Google Maps API v3: data layer IDs undefined

最后都变了- 提交于 2019-12-10 16:27:32
问题 long-time lurker, first-time poster here, so be gentle... I'm building a map that uses data parsed in from a MYSQL db via PHP to set the colour of polygons defined by a geoJson file (it uses this example on the Google dev site as a template). The problem I'm having is that the data layer won't automatically initialize when the page loads. The full javascript/HTML is posted below, but the section of code that was used in the example I'm following to initialize the data layer is: google.maps

MongoDB 2dsphere index fails (malformed geometry?)

前提是你 提交于 2019-12-10 13:28:26
问题 I'm currently trying to build an 2dsphere index, but the creation seems to fail. The document on which the index creation fails is valid geojson (according to geojsonlint). Also as far as I can see it obeys the MongoDB "Polygon" rules. I would appreciate any help, since I can't figure out why the index creation seems to fail. Thanks in advance! db.poly.ensureIndex( { loc: "2dsphere" } ) { "createdCollectionAutomatically" : false, "numIndexesBefore" : 1, "ok" : 0, "errmsg" : "Can't extract geo