New answers tagged

0

Thanks to the help of @user1919 who pointed me to the solution proposed in Stackoverflow, I could edit the existing layer with the plugin Leaflet.draw without customizing it ( at least not it's code ). The edits now are made on the onEachFeature function in the L.geoJSON call like this: var selectedFeature = null; function handleJson(data) { ...


0

I have this... And I want to join this attributes to the polygon automatically: Because I'll have to replicate this on tones of those polygons.


1

I think it has something to do with the fact that your geojson data should be more like this : { "type": "FeatureCollection", "crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } }, "features": [ // and here go all your features ] } while I don't have a good solution to solve it using OL3, you can try a work-around by ...


2

You can do this through the Vector -> Distance Matrix tool in QGIS. One of Ujaval Ghandi's excellent QGIS tutorials explains exactly how to do so here: http://www.qgistutorials.com/en/docs/nearest_neighbor_analysis.html


1

In case there are those who may run into the same issue, here is my solution (that works beautifully!) from qgis.core import * from qgis.gui import * from PyQt4.QtCore import * source_dir = '/home/cassandra/desktop/file_formats/ENC_ROOT/US6SP10M/shapefiles/SOUNDG.shp' name = 'SOUNDG' output_dir = '/home/cassandra/desktop/file_formats/ENC_ROOT/US6SP10M/...


1

I believe My Maps from google will let you share a map so people can add places. Since lots of people know how to use google maps, the interface will be familiar


5

I think that your issue is only a "Zoom In" problem. I'm going to render to tif these random points with Raster-> Conversion -> Rasterize (Vector to Raster) Tool (cell resolution 30 x 30) of QGIS; equivalent to your standalone Python script. Loaded raster layer looks as if no point had been rasterized. However, with point layer as first layer, 'Zoom In'...


1

That's probably because in your Geojson data there is no ID so the function getId() won't return anything or at least not what you expected. The ID you are using is just an attribute (property ) in your Geojson data like the name or X, Y ... You can keep using it with get('id') or recreate your geojson data and set a real ID not a property one


0

A quick example to describe how the instanceof function works in this case: map.getLayers().item(1) instanceof ol.layer.Vector this code yields true in my case as item(1) is a vector layer map.getLayers().item(2) instanceof ol.layer.Vector this yields false in my case as item(2) is an Image layer


0

whatever type of vector layer you are using you can add this function in OpenLayers 3 to fit your map extent to the layer one: var extent=yourVectorSource.getFeatures()[0].getGeometry().getExtent(); yourVectorSource.forEachFeature(function(feature){ ol.extent.extend(extent,feature.getGeometry().getExtent())}); yourMap.getView().fit(extent, yourMap.getSize())...


1

If you do not have qgis installed, still you can do it online. Point2Poly You need to browse your csv file and select the latitude and longitude fields, then generate the shapefile.


0

For newer Openlayers 3 the array is not kept in the Layer any longer. You can get by the interaction.select itself: //get features as collection var features=interaction_select.getFeatures(); //get length (.length doesnot work in my case) var int_features=features.getLength(); //or access by numeric index like any collection var first_item=features.item(0); ...


0

Old question but I was searching for this today - here is what I did: layer = iface.activeLayer() QgsVectorFileWriter.writeAsVectorFormat( layer, 'H:/temp/' + layer.name() + ".shp", "utf-8", layer.crs(), "ESRI Shapefile", 1) The boolean option '1' at the end of the command results in saving just the selected features of the layer.



Top 50 recent answers are included