All Questions
1,095 questions with no upvoted or accepted answers
11
votes
0
answers
1k
views
What is the convergence threshold for ArcGIS Iso Cluster?
The ArcGIS tool Iso Cluster Unsupervised Classification does not seem to have any documentation on the convergence threshold used in the tool. To compare, Erdas Imagine has all of the necessary ...
8
votes
0
answers
470
views
OGR failing to unpack polygons and respective holes from shapefile
I'm trying to unpack shapefiles in Python (v3.7.4) using the GDAL-OGR library (v2.3.3). Each shapefile has only one feature containing multiple polygons with holes. They cannot be produced differently....
7
votes
0
answers
5k
views
When does a QGIS .qix spatial index of a shapefile need to be re-created?
I understand the basics of spatial indexes but would like to understand when exactly a spatial index would need to be re-created or updated?
The reason I ask is because when a folder was moved to a ...
7
votes
0
answers
2k
views
What is the best way to display a large shapefile (with polygons) as a layer on a leaflet map?
I have a leaflet map of the UK with around ~2000 points total points and a bit of metadata loading for each point with two side-panels showing the metadata. These points are drawn from several tables ...
6
votes
0
answers
1k
views
How to select points with point ids from external list
I have a point shp and list of point IDs in CSV file which match with point IDs in the shape. Points in SHP have location while points in the external file don´t.
How can I select points in the shp ...
6
votes
0
answers
2k
views
QGIS: Release file lock on file used in a processing algorithm at the end of script
I am using runalg (qgis:joinattributesbylocation) on two QgsVectorLayer objects. At the end of my script I'm trying to delete all the files created during the script. I can delete everything except ...
6
votes
0
answers
1k
views
How to set Vertical Coordinate system when creating a 3D shapefile?
I'm working with GDAL v1.11 and am seeing the vertical CS stripped when exporting a 3D shapefile (from oracle spatial). This is the command I'm running:
ogr2ogr -f "ESRI Shapefile" B_POINT.shp (...
5
votes
0
answers
260
views
(QGIS 3.20) Adding features while spatial index is created makes them disappear
I am encountering a weird behaviour in QGIS 3.20 on Windows.
Steps to reproduce:
Create an empty project
Create a SHP layer.
Add a few features.
Save the changes to disk
At this point everything is ...
5
votes
0
answers
462
views
ogr2ogr creates too many columns with LEFT JOIN
I am creating a GeoPackage using several shapefiles using ogr2ogr (GDAL 2.2.4):
ogr2ogr -f GPKG /path/to/out.gpkg -append -nln out -a_srs EPSG:4326 /path/to/in1.shp
ogr2ogr -f GPKG /path/to/out.gpkg -...
4
votes
0
answers
873
views
Reading zipped shapefile from URL directly into QGIS
I need to request a shapefile from an OpenTripPlanner Server and read the file directly into QGIS without saving the file to a disk.
Background and requirements:
Users system wont be able to write ...
4
votes
0
answers
271
views
Spatial regression: general nesting spatial model using splm package in R
I have a shapefile of panel data (multiple years of observations for each polygon). I am estimating fixed effects spatial regression models with this data. I used one year of this data to generate a ...
4
votes
0
answers
283
views
Inconsistently getting "Input shapes do not overlap raster", CRS appear to match
Masking topographic raster data by a shapefile (bedrock geology polygon).
Following this guide I do this:
with fiona.open("geology.shp", "r") as shapefile:
geology_mask = [...
4
votes
0
answers
594
views
What happens if you set QGIS as the default program to open a *.SHP file?
In the screenshots of shapefiles in this question, Accessing downloaded shapefiles/attribute data?, you can see that the .shp files have the QGIS logo as its icon.
I think this means that on that ...
4
votes
0
answers
379
views
How to increase Compression Memory for ECW Opacity Builder
I am attempting to build opacity within an ECW file using ECW_Opacity_Builder.exe from APOLLO Essential Utilities 2014, which has worked flawlessly many times before.
When attempting to build opacity ...
4
votes
0
answers
756
views
How to remove black pixels in Landsat image
Does anyone know how I can remove these black pixels around the edge of this Landsat image? They appeared when I layer-stacked the bands in ERDAS IMAGINE - they were not there in the separate band ...
4
votes
0
answers
526
views
Import Large Shapefile to Postgres
I'm trying to import a large dataset to Postgres, of about 600MB, that sits on a remote AWS server. But I get the following error
Not enough memory to allocate requested memory (nRecords=26923892).
...
4
votes
2
answers
2k
views
Searching for UN regions/sub-regions shapefile
for a visualisation project I need the boundaries of the UN regions as defined here : http://unstats.un.org/unsd/methods/m49/m49regin.htm
That's 21 polygons for the sub-regions.
I have been looking ...
4
votes
0
answers
2k
views
How to build .vrt of shapefiles?
I've a huge number of shapefiles and I would like to create a VRT as I do with gdalbuilvrt for raster.
I find here https://github.com/dwtkns/gdal-cheat-sheet that it should be possible and the format ...
4
votes
0
answers
1k
views
How to clip a big shapefile from another shapefile's extent
I am working on mangroves in Sundarbans (Bangladesh / India), using Landsat pictures.
I need to equalize them in reflectance, before classification, for the evolution of the biomass in this region.
I ...
4
votes
0
answers
1k
views
Creating Shapefile spatial index programmatically in .NET?
I am creating a shapefile programmatically using DotSpatial using the following example syntax / pseudo code
FeatureSet features = new FeatureSet(DotSpatial.Topology.FeatureType.Polygon);
features....
4
votes
0
answers
1k
views
Open shapefile in ArcGIS Runtime WPF SDK as Graphics/Feature layer
I Googled and followed this tutorial and figured out how to import Shape files and Rasters into Runtime.
However, it seems most of the functionality uses a FeatureLayer/GraphicLayer instead an ...
4
votes
0
answers
2k
views
Ogr2ogr: Unable to open datasource problem
I downloaded the Precints shapefile from the City of Boston's data hub, and I'm trying import it into SQLServer (I'm running the Express verson). I've already created the database in the SQLServer (...
4
votes
1
answer
2k
views
Counting and rasterizing polygon overlaps in QGIS?
I have a large number of polygons that are overlapping. I'd like to create a heat map and plan on using raster calculation to do this. My plan: to give each polygon a raster value of 1, and adding ...
3
votes
1
answer
86
views
How can we tell how similar two countries look on a map?
Suppose I have these 2 maps:
I can represent these two maps in matrix form:
map1 <- matrix(
c("R", "R", "R", "R", "R", "R", "R&...
3
votes
1
answer
120
views
How do I dodge overlapping line/polygon layers so that each is visible in QGIS?
I have 3 separate polygon layers that often overlap (image below). How do I change the symbology in QGIS to have them parallel to one another and not overlapping? (as shown in the second image below).
3
votes
0
answers
644
views
How can I get GADM level 0 (countries) shapefiles?
When downloading GADM data from their website (https://gadm.org), It is highly suggested to download it country by country. I would need the whole world at once with only level 0 geometries.
The ...
3
votes
0
answers
219
views
Create new grid based on another grid (shapefile) in QGIS
I have an shapefile of the historic grid Messtischblatt which is a CRS formerly used in Germany for the topographic map at a scale of 1:25,000. The CRS is OGC:CRS84 - WGS 84 (CRS84)
I want to further ...
3
votes
0
answers
177
views
How to properly convert from WKT to euclidean 3d points?
I am not a geoscientist (I do computer graphics), however I am trying to render some geospatial data encoded as a WKT file.
I have a POLYGON with 2 coordinates per point, which seems to be ...
3
votes
0
answers
658
views
Editing shapefile adding fields with values with pyshp
I'm trying to add some fields to a shapefile using pyshp. The code I have to far is:
import shapefile
# Read in our existing shapefile
r = shapefile.Reader(r"C:\...\Edit_SHP\TracksLines.shp"...
3
votes
1
answer
271
views
How do I append a shapefile to PostGIS table with multiple geometry fields using ogr2ogr?
I am having an issue when trying to append shapefile data to an existing table in my PostGIS database using ogr2ogr. The existing table has multiple geometry fields. When I append the shapefile the ...
3
votes
0
answers
301
views
Plotting the albedo using Python
import glob
import numpy as np
import pandas
import os
import rasterio
import geopandas as gpd
import matplotlib.pyplot as plt
def get_image_stats_only(img_array):
raw_stats_dictionary = {'mean':...
3
votes
0
answers
261
views
Reducing points but maintaining attributes from original shapefile
I have a shapefile with points but there are a lot of points and I want to reduce the amount.
I have tried "Points thinning" which automatically reduces the amount of points but it loses all ...
3
votes
2
answers
1k
views
Geodataframe to PostGIS or shapefile
I have a GeoDatFrame df :
df.geometry.name
>>>'geometry'
df.loc[:, 'geometry']
>>>
Identifiant
0 MULTIPOLYGON (((2.827 42.691, 2.828 42.691, 2....
1 MULTIPOLYGON (((2....
3
votes
0
answers
82
views
Difference in raster pixels between Windows x86 and Windows x64
I have a huge problem and I can not find a reason for it. I have two PCa, one in my house and the other in my workplace. The first one is an old notebook with Windows x86 and the other is Windows x64. ...
3
votes
1
answer
940
views
Extract point cloud data from shapefile with Python
I am trying to plot profiles from LAS data. So my first step is to extract the data using a shapefile. I found this piece of code on the laspy website and thought I could use it to do this :
def ...
3
votes
0
answers
812
views
QGIS 3.4.6 Cannot create fields in new shapefiles
Running 3.4.6 on Windows 10. Until today I have had no problems creating new shapefiles and fields. Now when I create a new shapefile everything in the new dialog box works as usual when I create ...
3
votes
1
answer
275
views
Merge hole between shapes into any neighbouring shape to remove it?
I have a shapefile that I made by from 2 distinct shapefiles (I am using QGIS). The issue is that they don't overlap precisely so I have holes like the following:
I tried the vertex editing tool but ...
3
votes
0
answers
153
views
QGIS – Edits to shapefile attribute table won't save special characters
I'm working in QGIS with a Government of Canada shapefile of all 338 federal electoral districts.
The encoding is UTF-8.
In the attribute table, all of the em dashes ("—") that should appear in the ...
3
votes
0
answers
95
views
Shapefile polygon operation efficiency
I would like to make a graph from a shapefile, where edges would express spatial relations between polygons according to DE-9IM
For that, I use fiona + shapely
My code is working but it is extremely ...
3
votes
0
answers
458
views
ogr SetPrecision doesn't work
I'm creating a shapefile with a field type of real, but I want to lower the standard precision from 15 decimal places to 10, here is my code:
dst_filename = "Polygonized.shp"
drv = ogr....
3
votes
1
answer
508
views
Unicode problems while writing selected features to a new shapefile with Fiona
I have a shapefile with a large number of geographic features (marine protected areas). I'm trying to read through all of the areas in the shapefile, select those that fit a certain criterion, and ...
3
votes
0
answers
1k
views
"DBF file can not be opened" error using shp2pgsql
I am trying to import a shapefile using shp2pgsql. I wrote this command:
shp2pgsql -I -s 2154 -W "LATIN1" W:\IGN\BDPARCELLAIRE-RGF93-LB93-MAJ2013-V4\BDPV_1-2_SHP_LAMB93_D01\COMMUNE.shp CADASTRE....
3
votes
0
answers
82
views
Given a line find whether another line is along side, N,E,S,W or not
I have a shapefile representing roads (Black) and I need to know whether another line object (Red) is to the side of it. Including the orientation between them, to define whether the Red line lies to ...
3
votes
0
answers
2k
views
Draw shapefile over PNG image in R
I have a satellite image as a PNG with known coordinates (bottom, left, top, right). I want to draw a shapefile on it (the limits of a county) in R.
My first thought was to convert the PNG (it's read ...
3
votes
0
answers
241
views
GeoJSON files using too much memory?
I have about/more than 400 GeoJSON layer files in my QGIS project. When I checked the task manager memory, it displays qgis.bin.exe *32 using about 1,334,000 of CPU memory. I had another version ...
3
votes
0
answers
185
views
Join CSV to shapefile failing when in saved map document in QGIS
I am trying to join a CSV file to a shapefile by matching on attributes.
Here is the minimal workflow:
Import shapefile in blank document.
Save attributes of shapefile to CSV.
2.5 eventually, I ...
3
votes
0
answers
223
views
Enabling an Edit on Shapefile in QGIS only with a password?
I´m customizing some tasks in QGIS 2.14 using Python.
I am managing these edits in different layers (always shapefile layers, not database).
In one of them I want the users to enter a password ...
3
votes
0
answers
82
views
QGIS - Layer missing polygons after pointsfile transformation
I'm using pointsfile transformation in QGIS for the georeferentiation of my layers. After the transformation the result some times has polygons missing like here:
Why is this happening? How do I ...
3
votes
0
answers
544
views
Loading components of shapefile in QGIS?
I have a zipped shapefile with all components in place. It has a .shp file, a .dbf file and a .shx file.Projection file (.prj) and .sbn and .sbx files are also in place. I have tried loading the ...
3
votes
0
answers
273
views
Extracting cells from raster by attribute in ERDAS Imagine
I have a raster file that gives me the slope of all the hills and mountains in an area in degrees (0-90) and I need to extract all the cells which are >= 45 with an operator in the model builder. I ...