geojson

Cross-table serialization Django REST Framework

 ̄綄美尐妖づ 提交于 2019-12-08 05:45:17
问题 I have two models with a many-to-many relationship and I am trying to return some geojson by using the Django REST Framework. The data I am trying to return is th pub_date and coordinates (represented by a PointField in GeoDjango). Everytime I try and return the geojson I get the error Field name 'city' is not valid for model 'Article' . I'm pretty new to django/geodjango and this is the first time I've used the Django REST Framework. I've gone through the docs but can't work out where I'm

topoJSON on D3: map doesn't show (but it works on www.mapshaper.org)

我是研究僧i 提交于 2019-12-08 05:38:06
问题 I'm trying to replicate http://bl.ocks.org/mbostock/4060606 using a UK Counties map. I followed the following steps - pretty much what is suggested on http://bost.ocks.org/mike/map: 1) I downloaded the shapefile from Ordnance Survey and extracted some data using qGIS 2) when ready, I translated the shapefile into GeoJSON using ogr2ogr 3) I converted the GeoJSON into topoJSON making sure the IDs were preserved I pretty much copied the original example for the choropleth from mbostock. However,

Combining geojson and json for leaftlet

落爺英雄遲暮 提交于 2019-12-08 05:35:26
I have a Leaflet map with a GeoJson Layer on it var objJson = "https://raw.githubusercontent.com/salucci/Leaflet-Teste/master/BrasilNovo.json"; geojsonLayer = new L.GeoJSON.AJAX(objJson, { style: style, onEachFeature: onEachFeature}); geojsonLayer.addTo(map); info.addTo(map); And also have a Ajax request that receives Json data from a local PHP server. $.ajax({ url: "http://127.0.0.1/projects/phpController.php", type: "POST", dataType: "json", data: {"Codigo": 1100023}, success: function(data){ console.log(data); //here is my data }, error: function(error){ console.log("Error:"); console.log

Can I style different GeoJSON layers using the same style function?

好久不见. 提交于 2019-12-08 05:09:49
问题 I am new to Leaflet and JavaScript. I would like to know whether or not I can code my Leaflet map in a more concise way. My map includes three GeoJSON layers in three different colors. I have set the colors by calling separate style functions for each layer. The function "style" returns blue, the function "style2" returns purple, and the function "style3" returns pink. I tell Layer 1 to use "style" and Layer 2 to use "style2", etc. The map is here: http://talia.droppages.com/ask/three_layers

Use $within with a buffered MondoDB Linestring

纵饮孤独 提交于 2019-12-08 05:06:33
问题 I need to evaluate the proximity of a Point to a LineString using MongoDB. Because the $near operator can only compare a Point to another Point , I need to generate a polygon out of the LineString , so I can use the $within operator. The distance between the LineString and the edges of the polygon should represent the radius I want to search in, such as represented in red below: What might be a useful algorithm in order to accomplish this? 回答1: I think much easier would be to write your own

Showing GeoJSON data on overlay

房东的猫 提交于 2019-12-08 03:29:43
问题 I'm trying to show/hide some GeoJSON data on an overlay layer. I've the data as an object, but not at some server. If I use the overlay type 'geoJSON', I'm getting a Eror: A base layer must have an url How do I show/hide my data using the overlay show/hide? The mixed-layers-overlays-geojson-example is not working for me because it uses remote (xyz-json) data. Additional information: I've the data in some object that I'm intending to modify/update based on user interaction. PS: it's probably

display() in geojsonio gives 401 error

安稳与你 提交于 2019-12-08 03:28:20
问题 I am trying to Visualize a geojson file. import geojsonio as gj contents = open("taluk.geojson").read() gj.display(contents) But it gives the below error: AuthenticationFailed Traceback (most recent call last) <ipython-input-27-2a5e2058a16e> in <module>() ----> 1 gj.display(contents) C:\Anaconda\lib\site-packages\geojsonio\geojsonio.py in display(contents, domain, force_gist) 34 35 """ ---> 36 url = make_url(contents, domain, force_gist) 37 webbrowser.open(url) 38 return url C:\Anaconda\lib

D3js generate paths from GeoJSON

家住魔仙堡 提交于 2019-12-08 02:56:22
问题 I'm new to D3js and GeoJSON and would like to know how can I can render my polygons from GeoJSON file. My GeoJSON file comes from ESRI Shapefile without prj File, so I have no Information about the projection but its definitely not WGS 84. With an third party tool I can convert my GeoJSON to SVG and the format looks like this: (I have more then 65000 paths.) <path style="fill=blue;stroke-width:0.035;stroke-linecap:round;stroke-linejoin:round;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke

Getting GeoJSON Data to Leaflet Map using ngx-leaflet, HTTPClient and Angular2+

天大地大妈咪最大 提交于 2019-12-08 00:58:05
问题 I'm using the ngx-leaflet demo to try and get a GeoJson from a get request to display on the LeafLet Map. I have built a valid GeoJson using http://geojson.io/, and double checked it using the http://geojsonlint.com/ (Thanks for those tools guys) We have no errors in the compilation or displaying in the console log. Serves fine but our geojson object is nowhere to be found. I'm just looking to display the geojson data on the map. Any help or advice is appreciated. Angular CLI: 1.6.5 Node: 8.3

How to add GeoJSON points as a vector tile in Leaflet?

僤鯓⒐⒋嵵緔 提交于 2019-12-08 00:49:43
问题 I've read through every question on Stack Overflow I can find and every example I can find on the web for adding GeoJSON vector tiles to a leaflet map. Unfortunately I still can't manage to wrap my head around it, much less get it work on my data. I have a GeoJSON (here) with many points. I can add it just fine as a layer in Leaflet, so I feel confident that it's a valid file with real values. I've tried geojson-vt and leaflet vector grid. geojson-vt keeps returning an error: Uncaught