New answers tagged

1

I have a solution. You can load the geojson files using jquery. for this you have to add jquery in your program; i.e. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.0/jquery.min.js"></script> And replace your code by: $.getJSON("{% url 'work' %}", function(data){ var geojson = L.geoJson(data, { onEachFeature: function(...


0

To combine your street data with the speed limit data into a single file, you'll need to do a GIS operation called a "table join". You can use something like QGIS to bring in your geometry dataset (streets), as well as your additional attributes table (speed limit). You'll essentially be adding a new column to the attribute table of your streets dataset, ...


0

INSTALL NODE FIRST -- https://www.guru99.com/download-install-node-js.html OPEN powershell install $geojsplit PS c:\users\rakesh>$geojsplit and now go to your geojson file location and run this script PS D:\Florida>node --max-old-space-size=500 C:\Users\rakesh\AppData\Roaming\npm\node_modules\geojsplit\bin\geojsplit -a 1 -l 30000 -v -o k D:/florida/...


1

With the first GeoJSON you wait till data is loaded and then add it as layer. With the second GeoJSON you are missing this step so data is not available yet at the time when it's being added to the map. Order of map objects creation is also important. First create map, then layers and then add layers to the map. It should look something like this: var map ...


0

On the theorical part, my question is not answered. But technicaly. I manage to get data right in Qgis by selecting all the geom, rotating by -90° and then swap X and Y.


1

Google Maps Platform has extensive documentation on using GeoJSON data. Although it is not a Google map, you could try looking into the Leaflet package which has support for GeoJSON objects. You can then build the appropriate AJAX calls around it to get the data you need. If you just want to look at the data visually (and are not really building a web ...


0

I had a similar use case and since I did not find any library available, I developed this python library: PyCristoforo. Github link: https://github.com/AleNegrini/PyCristoforo Version 1.0.0 only supports European countries, but I plan to release other countries soon.


0

It is possible to use ogr2ogr: ogr2ogr -f "FileGDB" output.gdb input.geojson


3

To access features in order you would need a features collection: var Source = new ol.source.Vector({ features: new ol.Collection() }); Source.addFeatures(new ol.format.GeoJSON().readFeatures(geojsonObject)); console.log(Source.getFeaturesCollection().getArray());


4

From the doc: getFeatures(): Get all features on the source in random order.


0

i think the problem you're hitting @Don is that feature ids will remain undefined if they are not explicitly set (docs) in the options object passed as the second parameter, like this: map.data.loadGeoJson( "cb_2018_us_cbsa_20m.geojson", { idPropertyName: "CBSAFP" }, features => {} ); also, i think the callback that can be ...


4

QGIS uses GDAL to write the GeoJSON file. GDAL uses the COORDINATE_PRECISION environment variable. In QGIS that variable is hardcoded with the value of 15 (the same as the GDAL default). If you really want this, you can submit it as a new feature request at https://github.com/qgis/QGIS/issues.


2

GDAL can create vector tiles with the MVT driver https://gdal.org/drivers/vector/mvt.html For converting GeoJSON data into vector tiles which are saved into MBTiles database file use a command like ogr2ogr -f MVT -dsco FORMAT=MBTILES -dsco MAXZOOM=10 target.mbtiles source.geojson Another option is to use Tippecanoe the https://github.com/mapbox/tippecanoe....


0

There are a few issues but for the most part the code seems to be fine. First of all, you are trying to use LandSat 5 MSS Raw scenes which has two problems There is no image in that collection for your location You are using B5 for NIR band and B4 for Red which should be B3 and B2 instead. Assuming you were not actually going for Landsat 5 MSS scenes, you ...


3

The issue in your code is that 'fetch' is asynchronous. Therefore, when creating the GeoJSON source, the 'stations' variable doesn't have yet any value. In this case, you'd need to use Promises, async-await or a callback. From the example above: Using a callback: fetch('https://libs.cartocdn.com/carto-vl/assets/stations.geojson') .then((response)...


0

The GeoSeries class in geopandas package has geom_type attribute which gives you type of features geometry. Please review link: Overview of Attributes and Methods. import geopandas as gpd data = gpd.read_file('data.geojson') data.geom_type # Here, geom_type returns GeoSeries # OUTPUT: # 0 Point # 1 LineString # 2 Polygon # dtype: object ...


2

It looks like the version of org2org you have on server was built without Postgres support, or the postgres driver is not installed. Note that in the list of drivers there is no PostgreSQL, org2org just tries all existing drivers and none of them understands the connection string - this is what the error message means. ogrinfo might provide better ...


1

What's wrong is that you are defining markers on the basis of feature property Icon, which is string, instead of using corresponding icon object. On possible solution is to define all icons as object, where properties are names of icons and values are icon objects. Then it's easy to reference icon by it's name. Relevant code would then look something like ...


-2

You could try to simply wrap those expression in a try-catch block: try{ GeoJsonLayer cul_els = new GeoJsonLayer(map, R.raw.cultural_elements, getApplicationContext()); } catch(Exception e) { e.printStackTrace() }


1

If you're on linux, try converting .shp files downloaded directly from the census website to geoJSON data using the gdal command line tool. For Debian/Ubuntu that means installing the gdal-bin package, and then running a command like this one: ogr2ogr -f GeoJSON cb_2018_us_cbsa_20m.json cb_2018_us_cbsa_20m.shp


2

You can use the following code import arcpy import os arcpy.env.workspace = "c:/data" arcpy.JSONToFeatures_conversion("myjsonfeatures.json", os.path.join("outgdb.gdb", "myfeatures")) For more details please refer to JSONToFeatures example


Top 50 recent answers are included