Hot answers tagged

3

In your if line you need to change your or to an and in the last part. if f4 == f5 and (f1 == f2 or f1 == f3) and (f6 != f7 and f6 != f8): This is because with f6 != f7 (6 != 5) it returns 1, even though f6 != f8 fails (6 = 6) in the second part. With the OR there it returns true if one of them is true. With an AND it would return true only if both are ...


2

I didn't knew geopandas, it is very easy to add a field, a great library indeed. You just need to read your file add it and save. dataSrc = gpd.read_file('my_shp.shp') dataSrc['new_field'] = 1 dataSrc.to_file('newfile.shp') Selecting is also straightforward: dataSrc = gpd.read_file('my_shp.shp') dataSrc[dataSrc['id']<4].to_file('new_shape.shp')


2

OK, I think I've solved my problem. The issue is noted at the github page for laspy here: https://github.com/grantbrown/laspy/issues/51 I needed to adjust the "start_first_evlr" property to be the full length of the LAS file as shown below. Not sure if that is the best way, but it seems to work. I needed to read the mmap size for the input LAS file (before ...


2

GDAL has no problem with GeoJSON http://geojson.org/geojson-spec.html. The following GeoJSON encodes one multilinestring: { "type": "FeatureCollection", "features": [ { "type": "Feature", "geometry": {"type":"MultiLineString","coordinates":[[[11.20558631,46.48251782],[11.2058444,46.48280049]],[[11.20578705,46.48252192],[11.20596731,46.48275133]]],"crs":{"...


1

Um, the Sentinel-1 sensor is C-band SAR (radar) data, not spectral. Given that NDVI is a spectral index of photosynthetically active radiation using the ratio between Red and NIR spectra, what makes you think that you can get NDVI from SAR polarisation? There is absolutely no way to derive NDVI from SAR data! Please, go research some basics on active and ...


1

Column and row along with the zoom level are needed to identify a specific tile. This section in the osm wiki shows how they are calculated.


1

Thanks to user30184! You helped me solve it. The SrcLayer must specify the same name as the CSV file. Here is the correct, working VRT file. The change is on line 4: <OGRVRTDataSource> <OGRVRTLayer name="example"> <SrcDataSource>D:\Temp\example_short.csv</SrcDataSource> <SrcLayer>example_short</SrcLayer&...


1

This is not a problem of Matplotlib but your script and the module you use for reading shapefiles 1) You know that there are points in the geometries of the Polygon shapefile thus eliminate try... except 2) you load and read the shapefile twice for x and y (memory) for shape in shp.shapeRecords(): xy = [i for i in shape.shape.points[:]] x = [i[0] ...


1

This would be extremely simple in PostGIS: SELECT line.unique_name, line.geom, COUNT(circle.geom), SUM(circle.attribute_name) FROM line JOIN circle ON ST_Intersects(line.geom, circle.geom) GROUP BY line.unique_name, line.geom; In QGIS 2.14 there is the option of creating a "Virtual Layer" which might work for this. But the performance is not as good with ...


1

You can use the srsName= string to get the polyline from the WFS in lat/lon coordinates from the start. Alternatively, provided that you've read the coordinate strings into Python as arrays x and y, you can do import pyproj prj = pyproj.Proj(PROJ4_STRING) lon, lat = prj(x, y, inverse=True) where PROJ4_STRING is the libproj SRS string for the original ...



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