All Questions
896 questions
3
votes
2
answers
2k
views
Writing shapefile with projection defined crashes fiona
I've just started trying to use Fiona to write out shapefiles. I found the example code below, which seems to work fine
from shapely.geometry import mapping, Polygon
import fiona
# Here's an example ...
3
votes
2
answers
885
views
Extract PostGIS line features to GPX
I have a request to provide GPX files of certain trails (around 100) that are present in OpenStreetMap. Given a local PostGIS install with OSM data, I think the process would be something like:
...
3
votes
1
answer
2k
views
Export to SHP with ArcPy with query [duplicate]
I have a shapefile with table with area code (field areacode).
How can I export with ArcPy each unique area code so I get a SHP file for each one?
It takes too long to select the layer and query ...
3
votes
1
answer
2k
views
Convert from shapefile to GPX with selected attributes
I have a points shapefile that originally came from a GPX file (imported using QGIS). The original GPX file contained waypoints only and has disappeared.
The shapefile has many attributes, but only ...
3
votes
1
answer
5k
views
merging 2 polygon adjacent to each other using R
I have several shp files which are the components (or tiles) of a map, I have joint all these tiles together to have a large shp file. Then I realized some of the polygon is now split into 2 halves, ...
3
votes
1
answer
7k
views
Upload shapefile using GeoServer REST API and C#
I'd like to upload shapefiles using GeoServer REST API and C#. So far, I can create workspaces using the REST API and C#. From GeoServer documentation (specific to cURL), the difference between ...
3
votes
2
answers
2k
views
Unwanted spaces being placed in shapefile text fields by ArcGIS Desktop?
I have a table with a row Page_Number_N some of the rows have values and others just have a space. For example record 4 is just a space. Field values are Strings.
1
2
3
5
When I start an edit ...
3
votes
1
answer
2k
views
Exporting Shapefile to SVG using Java & GeoTools?
I am currently working on how to read in ESRI shapefiles, parse/edit layers and then export out to SVG (Scalable Vector Graphic) file type. I have been using GeoTools primarily for reading/loading ...
3
votes
4
answers
3k
views
Converting Esri ASCII raster to Shapefile for CartoDB?
I have an ArcGIS grid ascii file (Ramankutty Cropland at 5 minute resolution) that begins as follows:
ncols 4320
nrows 2160
xllcorner -180
yllcorner -90
cellsize 0....
3
votes
1
answer
3k
views
Creating new shapefile after merge operation using unionSpatialPolygons
I only recently started playing with shapefiles and R packages for manipulating them. I am looking at creating a new shapefile based on merged polyons by following this example, however, I cannot seem ...
3
votes
5
answers
16k
views
Reducing size of KML file (after converting from Shapefile)
I have a shapefile of size 224 MB. I am using ArcGIS to convert it to a KML file. The process involves converting the shapefile to a feature layer and then converting the layer to KML.
An ...
3
votes
6
answers
3k
views
ESRI Shapefile not loading into SQL Server
I have been loading a number of shapefiles into SQL server 2012 using ogr2ogr.exe and the MSSQLSpatial driver. Up until this point, I have been very successful with doing so.
However, I have now run ...
3
votes
1
answer
2k
views
Removing land area from marine region polygons using R
In my pursuit to merge multiple polygons for the purpose of calculating the surface area of marine species distributions, using shapefiles from Marineregions, I am now trying to remove potential land ...
3
votes
1
answer
2k
views
MOD 35 Cloud Mask HDF in ENVI
I am having difficulty getting ERDAS or ENVI to correctly read and display cloud mask attributes from MOD 35 HDF files. They files are displayed as 0-255, whereas I expected some kind of code 0, 1, ...
3
votes
1
answer
1k
views
Closing spaces within polygon in QGIS?
I have a shapefile displaying the borders of several city units. One of its polygons, however, had free space consisting of four vertices in it. I created another polygon inside the free space and ...
2
votes
2
answers
7k
views
Only read specific rows of a shapefile with GeoPandas / Fiona
I would like to read in only certain rows of a shapefile using GeoPandas. I've read approach for limiting columns of shapefile to read in, which I may use as well (Only read specific attribute columns ...
2
votes
1
answer
1k
views
Filter by attribute names from another layer in QGIS
I have some difficulties with a task I have.
Data: layer 1 (tmc_segments), layer 2(regional_roads(earth)). Layer one contains simplified geometry of the road network (just simple lines with data ...
2
votes
3
answers
1k
views
Rasterize and sum polygons in Python
I have the following shapefile of NYC with all 5 Boroughs as separate polygons, called Boroughs.shp. Data Source (NYC OpenData): https://data.cityofnewyork.us/City-Government/Borough-Boundaries/tqmj-...
2
votes
1
answer
2k
views
Seeking shapefile of Indian electricity grid? [closed]
Does anybody know where I can find a shapefile of the major components of the Indian electricity grid?
Ideally, I'd get transmission/other high-voltage lines, substations, generating units, and ...
2
votes
1
answer
518
views
Points along one or more lines at a time, with rotation
I'm using ArcMap 10.3, and I have several lines, that I would like to add arrows along at a defined interval, with that lines rotation, so the arrows point correct way along the line.
When I use the ...
2
votes
1
answer
2k
views
Modifying feature attributes of a shapefile in geotools
I have a shapefile with an attribute I want to compute programmatically in Java for each feature. I have found a lot of documentation on how to read and create shapefiles with geotools (http://docs....
2
votes
2
answers
2k
views
ogr2ogr SHP to MSSQL import leaves geometry column empty
I am trying to import a Shapefile with polygon features into MSSQL database with this command:
ogr2ogr -f "MSSQLSpatial" "MSSQL:server=***;uid=***;pwd=***;database=***" "D:\...
2
votes
1
answer
359
views
Attribute Table Default Order in QGIS
I'm having an issue with QGIS version 3.2 Bonn. For my class, a question asks, "What city corresponds to row number 1713 for the Colleges and Universities shapefile?". I'm having issues answering this,...
2
votes
1
answer
109
views
Calculating common area between shapefiles using GDAL
I'm looking for a way to get the intersection area between my shapefiles.
Basically, I got three shapefiles from my .tif files like this:
gdaltindex a.shp a.tif
gdaltindex b.shp b.tif
gdaltindex c.shp ...
2
votes
2
answers
3k
views
Unable to create shapefile using shapefile.py
I am trying to create shapefile from csv data using shapefile.py but i am constantly getting this error,
Traceback (most recent call last):
File "createShp_Davis.py", line 31, in <module>
...
2
votes
2
answers
134
views
Convert two polygons to one
I use QGIS 2.18.5 and I get in stuck with two polygons I cannot solve.
I want to make a new polygon from these two which looks like this:
I made thew new one:
Cut 1 polygon and paste to other layer. ...
2
votes
1
answer
691
views
QGIS show gdal_polygonized file in EPSG:54004 instead of EPSG:3857
I am polygonizing a TIFF with the gdal_polygonize.py and the resulting Shape is shown in QGIS in the wrong projection - EPSG:54004 instead of EPSG:3857.
I have a TIFF in EPSG:3857 and polygonize it ...
2
votes
1
answer
771
views
Valid values of mollweide projection in QGis
i just imported a vectorlayer (without any reference points) to qgis as mollweide projection to save it to longlat. What i am wondering about is a mathematical problem: Not every x,y coordinate on the ...
2
votes
3
answers
5k
views
Calculating polygon area within polygons in QGIS
I want to estimate the area of the reef under a polygon grid.
My shapefiles are already in meters, however I am having a hard time calculating the area under the grid layer. Attached are the photos.
I ...
2
votes
2
answers
1k
views
Geometry Errors with Imported Shapefile, Unable to Fix
Software Used
QGIS 2.18.10
MS Excel 2016
GitHub Repository With Files (link)
Update 3
Blank file when reprojecting
1. Open the layer
2. Double-click Reproject Layer
3. Select Reprojection ...
2
votes
3
answers
6k
views
Multi-geometry shapefiles
Since a shapefile can only contain a single geometry type (e.g. point, polygon, etc), how could I persist both?
If I must create a shapefile for each geometry type, how can I pass them to a ...
2
votes
3
answers
15k
views
Masking NetCDF data using shapefile (xarray & geopandas) [duplicate]
I am using the following packages:
import pandas as pd
import numpy as np
import xarray as xr
import geopandas as gpd
I have the following objects storing data:
print(precip_da)
Out[]:
<...
2
votes
1
answer
296
views
Combining several layers in ArcGIS Desktop using Intersect gives WARNING 000117: Warning empty output generated?
I'm using ArcGIS 10.3
I have the following 4 layers (all are polygons)
You can find these layers in this link
DATA
Sites: 5 subcatchments (Site1 to site5) and site 5 combine all
subcatchments ...
2
votes
3
answers
8k
views
Convert vector points to GPS waypoints and route
I have a shapefile with a series of points (around 300) using British National Grid. I need to put them on my Garmin Etrex 10 as waypoints.
Can someone tell me how to convert this shapefile into ...
2
votes
3
answers
1k
views
Use field calculator to change values from a,b,c etc. to 1,2,3 etc.?
I have a vector shapefile with a column with string values. How can I convert this to a column of integer values in another column but keep the categorization.
e.g. from:
col1,newcol2
A,
A,
B,
A,
C, ...
2
votes
2
answers
2k
views
NoData Value = 0, problem when creating NDVI, Erdas
I try to create an NDVI from Landsat and ASTER satellite images using Erdas Imagine. In Erdas, the satellite images have a nodata value of 0.
After creating an NDVI, the nodata value is still 0, but ...
2
votes
1
answer
2k
views
Rebuilding .shx using python/pyshp?
EDIT: I've tried running the code linked in the duplicate flag, it's posted here for reference, and it doesn't run. I had already referred to that answer in my initial post.
My problem
Downloaded ...
2
votes
1
answer
13k
views
Calculating distance between latitude and longitude points using python
I have a database of 2000 points, which is in CSV format containing latitude and longitude. I want to find the distance between all these points, and then show these points in a map by using pyQGIS; I ...
1
vote
3
answers
63k
views
Converting .lyr to .shp in ArcMap?
Does anyone know how to convert a .lyr to .shp format in ArcMap 10.2?
I had a look at different forums on the internet and most people suggest that it works by right clicking on the layer in the TOC ...
1
vote
2
answers
997
views
Length of Feature
I have a shapefile which renders a map.
I want to calculate and preferably store length of each feature in the shapefile either using QGis or through programmatic means.
What is the best way to get ...
1
vote
1
answer
1k
views
QGIS corrupting shapefiles?
I'm hoping someone out there might be able to help or suggest some tests to try and resolve some very odd QGIS behaviour of late...
Our core GIS team of 4 users has been testing v2.10 prior to roll-...
1
vote
0
answers
5k
views
Seeking block (sub-district) level boundaries for India?
I'm looking for block (sub-district) level shapefiles for India. The GADM database only has files for the 2300 Tehsils, whereas I'm looking for the about 5500 Census blocks (sub-districts) for any ...
1
vote
1
answer
1k
views
Creating centreline for every polygon in submarine canyon database using ArcGIS for Desktop Basic?
I have the Basic license for ArcGIS and so I cannot use the collapse dual lines to centreline tool or the river bathymetry toolset by ESSA as they both need an advanced license.
Any idea how I can ...
1
vote
2
answers
4k
views
Multiple rename shapefiles and feature classes in python
I have multiple shapefiles, in different sources (D:\GIS\Folder A", "D:\GIS_Temp\Name". And some of them have space in their name (File X, File Y, etc).
What should be the code that could rename all ...
1
vote
1
answer
1k
views
Using ArcPy to convert .txt to shapefile with coordinate system?
I tried to define my coordinate system on creating the shapefile but when I zoom to layer I don't see my features and ArcGIS crashes. I know it's not in the coordinate system I defined for it but it ...
1
vote
1
answer
1k
views
MapServer (MS4W) test page from shapefile shows only blank white square?
I am trying to create a test page with mapserver and shapefile. At the moment I just want to get the map shown on my test page.
I have gotten the EXTENT coordinates by opening shapefiles with QGIS - I ...
1
vote
2
answers
2k
views
shp2pgsql: how to know the schema.table?
I want to import a shapefile using shp2pgsql. I am using Mac with Postgis 2.2.
Based on this reference: A conversion and upload can be done all in one step using a UNIX pipe:
shp2pgsql -s <...
1
vote
1
answer
95
views
New Geocoded Points Layer Misaligned With Polygon Layer
I learned on ArcGIS, and I'm familiarizing myself with the use of QGIS. So far I love it, but the process of re-projecting and transforming datums seems less intuitive than in Arc.
I recently ...
1
vote
1
answer
1k
views
rotate point along line layer [closed]
I have two layers: point and line (postgis or shp)
The line layer represent a hiking trail. The point layer the mountain passes. The points are exactly on the same position like the node of the line. ...
1
vote
1
answer
102
views
Save certain ogrinfo results to variable in Python [closed]
I am using ogrinfo in Python to obtain information about a shapefile.
My code is as follows:
from subprocess import Popen, PIPE
args = ['ogrinfo', '-ro', '-so', '-al', 'C:/test/test_shapefile.shp']
...