Hot answers tagged

7

So the JSON you are using is just simple JSON not GeoJSON. The main difference is that the GeoJSON contains a geometry object you can read more about here in the GeoJSON spec. You can however convert your JSON to a CSV file and load it into QGIS that way. Go to a site like this one and put in the URL to your JSON. I plugged in "http://www.nanaimo.ca/...


4

It might be worthwhile looking at the CartoDB Import API. You can set up syncing a file from a URL with a simple cURL command. Check out the documentation and the example at this link. It may help get you started down the right track. OR While the import API is one possible method, it looks like you can sync GeoJSON if it is hosted on the web somewhere. ...


2

Your data is stored in the features array. You can access that by specifying a custom datasource within the ajax property like this: "dataSrc": "features". I haven't found a way to get the GeoJSON property "type": "FeatureCollection" that way, it is outside of the actual data "rows". The complete code: $(document).ready(function() { $('#example')....


2

I do not believe it's possible to limit the records retrieved from a geojson file. A complete geojson data structure is always an object, so if you only fetched a part of it (for example using an http range request) then you would get an invalid json syntax - missing either the opening or closing brace and the json would not be parseable by the browser. ...


2

Where can I find data to produce these sort of visualizations? You're asking for administrative boundaries. How to get the official version depends on the country's administration. As far as I'm aware, a normalized dataset for all official administrative boundaries doesn't exist. IMHO the closest you might get to that is Natural Earth or OpenStreetMap. ...


2

You could use the CartoDB SQL API with CartoDB.js to call the data that you want to display depending on where the user click. In this section of the CartoDB documentation you can find more information about using theCartoDB SQL API within CartoDB.js. In this example you can find how a buffer is created everytime that a user clicks on the map and the points ...


1

you want to create a layer with a single feature so you must use: features: [features[0]]


1

1) I just don't know how to convert .geojson file to .shp. This is a one of the bases of ogr Python. If you have a geometry, it is very easy to convert it to a shapefile # geojson is GeoJson Polygon from osgeo import ogr output = "geojson.shp" driver = ogr.GetDriverByName('ESRI Shapefile') if os.path.exists(output): driver.DeleteDataSource(output) ...


1

There are now Python modules easier to use for that, as rasterio Rasterio employs GDAL to read and writes files using GeoTIFF and many other formats. Its API uses familiar Python and SciPy interfaces and idioms like context managers, iterators, and ndarrays. Therefore from Masking raster with a polygon feature in Rasterio Cookbook import rasterio ...


1

I only want the few that should be displayed in the current bounding box Why? Unless there's a performance hit, you shouldn't filter the results - when you pan the map, you'll have to manually recalculate the visible points again. If there's a performance hit due to a large number of points, use some clustering/decluttering leaflet plugin first (these ...


1

I'd use the OpenLayers Format readers and writers. GML reader here http://dev.openlayers.org/apidocs/files/OpenLayers/Format/GML-js.html GeoJSON writer here http://dev.openlayers.org/apidocs/files/OpenLayers/Format/GeoJSON-js.html May be overkill to just convert from GML to GeoJSON, but OpenLayers API are widely used and tested, and also easy to extend. ...


1

I hit a similar problem. I just needed to find the valid records in my dataset (I discarded the records with Duplicate Vertices). I renamed the collection - db.myCollection.renameCollection('myCollectionBk') Then I added a single record from the original collection into a new collection and added a geospatial index to the collection db.myCollection....



Only top voted, non community-wiki answers of a minimum length are eligible