Hot answers tagged

5

You need to set Layer Options > GEOMETRY to any option except <Default> in Save Vector Layer as... window.


3

You can use the geometrygenerator to display parts of your multilinestring in different colors. With the expression: geometry_n($geometry,2) you will get the second part of the multilinestring. Then you can choose a color or special linestyle for that. see image below. It is one Multilinestring with 3 parts in different colors.


3

I'll just copy-paste my response to Leaflet bug #6173 : I'm reading the OGC's Simple Feature Access specification (again), to remind myself about the formal definitions of Polygons and MultiPolygons. Let me quote page 31: 6.1.14 MultiPolygon A MultiPolygon is a MultiSurface whose elements are Polygons. The assertions for MultiPolygons are as follows. a) The ...


1

Use setStyle() instead of modifing the property. const onEachCountry = (country, layer) => { console.log(country.properties.color) //This shows me that some of the country colors has been changed layer.setStyle({fillColor: country.properties.color}); // this should change the color of the map according to country.properties.color. But even after ...


1

GPX XML schema definition (see https://www.topografix.com/GPX/1/1/) states that <trk> element can have several members that describe it. Leaflet-omnivore plugin you are using to read GPX brings only two of them as feature properties to GeoJSON layer: <name> and <desc>. You are already using the first one to name your tracks, so you can use ...


1

pgRouting functions return an ordered list of nodes that describe the route. When you join the result with your network table to retrieve the geometry of the route, the linestring geometries are not necessarily in the correct direction. To bring them in the right direction, you need to compare the route's node ID's with the source and target value of the ...


1

As I said in my answer the GeoJSONDatastore module is unsupported that means that you use it at your own risk and accept the need to investigate and fix any issues you may find using it. I had a quick look over the weekend and I can get the latest (25-SNAPSHOT) version to install into GeoServer but not actually display the data on a map. Feel free to proceed ...


1

According to https://gis.stackexchange.com/a/367255/109339 the GeoTools GeoJSON Datastore "lacks the GeoServer wrapper that would provide you with a GUI element to allow you to set it up easily". Maybe there is a way to configure a datasource.xml in the data-directory of GeoServer, but I don't know or found an example.


1

The way is simple. You just need tobound your whole file in the JavaScript code and attach it to your map. It has been explained here: http://www.mkrgeo-blog.com/excel-spreadsheet-batch-data-geocoding-for-geojson-and-json-files/ If I would bring your example here it could look like this: var file = { your JSON data } Next save this file as the .js file ...


1

As @IvanSanchez wrote in his answer, problem comes from clicking on the default marker, which has no setStyle method. And there is definitely no need for two layers from the same GeoJSON source. Solution for what you want to achieve is to use just pointToLayer method to create marker and click event. Code could the look something like this: var clicked; var ...


1

Your code (which I adapted into a reproducible example here) is adding the dataset twice to the map, once as L.CircleMarkers... var trainGeo = L.geoJSON(wtsGeo, { pointToLayer: function (feature, latlng) { return L.circleMarker(latlng, tMarker); }, }); ...and once as default L.Markers... var clickLayer = L.geoJSON(wtsGeo, { style: ...


1

GeoTools (which provides the underlying data management for GeoServer) has an unsupported GeoJsonDatastore (gt-geojsonstore) which would allow you to publish GeoJson files via GeoServer if you drop the jar file into the WEB-INF/lib folder. But it would be very slow and would lack the nice GUI of a finished data plugin. GeoJSON is better suited as a transfer ...


1

The Loader wasn't receiving the data sent by Post. So, now the page where I do the query, receives the data in json format. Also I removed the vecLayer from the Map Layer Array, and added it to the map later because the vecLayer doesn't exist. I put it all in one function, and now it works. I would have to adjust map.getView (). fit (vectorParcels.getExtent (...


1

You need to ensure you're using the OSTN15 transformation from Ordnance Survey if you're going from OSGB to WGS84. In my experience DotSpatial doesn't use this which results in the shift you're seeing. QGIS does I believe out of the box. Details here: https://www.ordnancesurvey.co.uk/business-government/tools-support/os-net/for-developers Can't help getting ...


1

Here is a full answer with a if ... else if ... else condition : filter: function(feature, layer) { if (varState == "01") { return (feature.properties.field1 == "yes" && feature.properties.field2 == "yes"); } else if (varState == "02") { return (feature.properties.field1 == "yes"...


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