Tag Info

New answers tagged

0

The command line tool ogr2ogr should be able do that. Something like: ogr2ogr -f "GeoJSON" dst.json src.svg Both of those formats are supported http://www.gdal.org/ogr_formats.html. If you're not familiar with ogr2ogr, the easiest way to download and install it is probably through https://trac.osgeo.org/osgeo4w/.


1

Try code example: var app = angular.module("app", ["leaflet-directive"]); app.controller('MapController', ['$scope', '$http', 'leafletData', function($scope, $http, leafletData) { angular.extend($scope, { london: { lat: 51.505, lng: -0.09, zoom: 8 } }); $http.get("test.geojson").success(function(data, status) { ...


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, };


0

SQLite has R*Tree support, which is probably the best way to approach this problem. See https://www.sqlite.org/rtree.html for an explanation of the concept and implementation. That also explains that your SQLite may have the R*Tree disabled, so that would obviously be worth a check first. If that is a bit too much complexity, consider just using Spatialite ...


0

Since this has not been answered. Here is my own solution which is very simple and works well. The "update" function clears the vector source. The "loader" function, which has been added to the vector source, will then automatically update the features using the url. var vectorSource = new ol.source.Vector({ loader: function (extent, resolution, ...


0

As @user30184 suggests, convert your shapefile to json and at the same time reproject it to WGS84 with: ogr2ogr -f GeoJSON -s_srs epsg:2180 -t_srs epsg:4326 wojeowdztwa.json wojewodztwa.shp Then, define the projection in your script like this: var projection = d3.geo.mercator() .center([21, 52]) .scale(2000) .translate([width / 2, height / ...


0

It looks like you've gotten thrown off track by the example you were following, which uses an old version (7.0.9) of the noUIslider library. The new version that you've included in your code (8.0.2) has different syntax for many operations, as described here. You should be able to get it working by changing one line, from range = $("#slider").val(); to ...


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, ...


0

Thanks everyone, finally i found out that i wouldn´t update the properties of my geojson. Everything is working now!


0

sorry after more searching I found it on this website pointToLayer: function(feature, latlng) { var smallIcon = L.icon({ iconSize: [27, 27], iconAnchor: [13, 27], popupAnchor: [1, -24], iconUrl: 'leaflet/icons/' + feature.properties.pcp + '.png' }); return ...


0

I noticed your shapefile has no .prj sidecar file. If you have installed the GDAL/OGR toolkit, it could be worth a try to attach the projection information to see if that brings everything to life. Use ogr2ogr to fix it.. Your data appears to be in WGS84 (i.e. EPSG:4326), so the following ogr2ogr command will create a new version of your shapefile with a ...


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

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, ...


0

I have the same problem right now. So there are my steps: 1)create tiles in tileMill 2)create .png tiles in qgis using plagin MBTiles extract 3)create canvas mask on custom layer 4)right now I try to write piece of code that will extract hex color of images, and than convert hex color to dynamyc legend(cause there are about 150 types of color)


0

If the file size is too big, and you mentioned that it's going to increase more in the future, you need to use raster tiles. Actually, you should use CartoDB, upload your dataset there, you can make the dynamic chloropleth maps based on your data the server returned to you (as you mentioned this requirement in a comment). CartoDb gives a function ...


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'); // ...


0

You could simplify the file. For this you could use QGIS. One option would be simplifying the lines, but that would probably break topology. Another option, depending on your file, is limiting the number of decimal places. That would reduce file size, but not complexity. Another option would be using TopoJSON. TopoJSON is perfect for administrative areas ...


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?



Top 50 recent answers are included