Tag Info

Hot answers tagged

3

GeoJSON is a JSON format, and in that, the order of the attributes is not important. It does not matter if you have the "type": "FeatureCollection" first, or after the "features" array. Both will work with all software that read GeoJSON. However please note, that I think you have another problem in your data. I think your latitude & longitude values ...


2

It might be easier to use shp2pgsl to directly load the shapefile into a PostGIS table, for example: shp2pgsql -d -I shapefile.shp table | psql -U user database If you prefer to use GeoJSON directly, there is ST_GeomFromGeoJSON, but for this (as I understand), you'll need to parse and insert individual features from the GeoJSON file. See this answer for ...


2

This is the compromise between client-side and server-side data handling. You can try using TopoJSON to make your file smaller, but it's a little tricky to run, and works better on polygons, including simplification. I think you're best off using a server platform. CartoDB is free for small use like this, and it's got other advantages like fancy ...


2

Qgis2web can minify the GeoJSON. That will gain you a bit. It can also reduce the geometry precision - the number of decimal places (as qgis2leaf can). Edit: qgis2web also supports scale-dependent visibility. Could this help?


2

As user30184 said, the importer extension has been designed exactly for this job, and will convert the data into the format of the chosen target store (e.g., will import the data into postgis or oracle for you). WFS-T is more geared towards single feature editing than "mass import" and can only handle GML anyways.


1

It appears there is a bug in your JavaScript code where you switch the style, you put 0 for the opacity for polygons have ownership type as "Private", and you will need to change it to 0.5 to get it fixed: case 'Private': return { fillColor: 'white', strokeWeight: 0.4, strokeColor: 'black', opacity: 0, };


1

For the ID simply pass it in to the featureBuilder instead of null; For other properties you need to modify the schema you generated the featureBuilder with. The easiest way to do this is to use DataUtilities.createType SimpleFeatureType TYPE = DataUtilities.createType("Test", "ian:String,location:Point"); final Point point = builder.point(132.159633, ...


1

I'm not sure exactly how your geojson is formed, but the style argument in L.geoJson allows you to set styles for each feature. From this example: L.geoJson(states, { style: function(feature) { switch (feature.properties.party) { case 'Republican': return {color: "#ff0000"}; case 'Democrat': return {color: ...


1

As @StevenKay mentioned, quotes on the GeoJSON should be escaped with preceding backslash. pgsql2shp -f tiles.shp -h <host> -u <user> -P <pass> <database> "SELECT id, the_geom FROM <table> WHERE ST_GeomFromGeoJSON('{ \"type\": \"Polygon\", \"coordinates\": [ [ [ -92.472398018272358, 18.086381878379395 ], [ -92.472398018272358, ...


1

I don't think you will need to call the highlightSelection function, try to update the onEachFeature function to something like the one below to append content to popup window for each layer: // Action for each feature of the choropleth function onEachFeature(feature, layer) { console.log("onEachFeature"); layer.bindPopup('hello, popup'); // ...


1

Nowadays, you can use the getBounds method of a MultiPolygon object and than use that to set a map's bounds. var multipolygon = L.geoJson(foret); multipolygon.addTo(map); map.fitBounds(multipolygon.getBounds());



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