Hot answers tagged

4

Looks like you're trying to add data to the insert cursor one column at a time. Cursors think about the world one row at time. I recommend the following code. A few other notes... Python code runs in order, so make sure you declare your outpath variable before you set your env.workspace to outpath. Also, this code is going to create a shapefile with the ...


3

YES The -spat switch is completely optional, and the typical use case is probably not to use it. I never use it, because when doing a shapefile import I have never needed only part of the shapefile (or I would rather get it all into PostGIS and then do a spatial selection there). ogr2ogr will run and import all features in the shapefile. Your statement ...


3

You could start with a shapefile of volcanoes and drop the file into QGIS. Then set the projection to EPSG:3832 to give you a Pacific centred map. With the addition of a Natural Earth raster as a backdrop you end up with something like: From there you just need to sketch in an outline if you need.


3

You are confusing terms and thus, confusing us. The expected input for kriging prediction in the gstat krige function is a systematic array of points and not polygons. It would also be nice if you provided a reproducible code example of what you have tried. You can use the extent of an sp object to create an array of points for the kriging prediction using ...


2

I would use Rename_management to make sure you get all the parts to the shape file: import os, sys, arcpy InWork = sys.argv[1] # this script designed to be used as a tool, replace with a path if you wish arcpy.env.workspace = InWork for thisFC in arcpy.ListFeatureClasses(): newName = thisFC.replace(" ","_") arcpy.Rename_management(thisFC,newName) ...


2

--- gdal --- use gdal_contour function. documentation here ---- ArcGIS version----- posted before the software was specified Assuming you are using ArcGIS: 1. Convert the GeoTiff into ESRI GRID (esri raster format) using raster to other formats function, or simply import it in arcGIS and use save (export data) and save it as ESRI GRID. 2. use the Contour ...


2

ogr2ogr/ogrinfo are great tools...but also...PostgreSQL provides two built-in tools for exporting (pgsql2shp) and loading (shp2pgsql) shapefiles. They are easy to use and well documented...see the docs and this cheat sheet. Quoting the PostGIS 2.0 docs: An example session using the loader to create an input file and uploading it might look like this: ...


1

The following would do it with your directories: import arcpy InWork = ["D:\\GIS_Temp\Folder A", "D:\\GIS_Temp\\Folder"] for ws in InWork: arcpy.env.workspace = ws datasets = arcpy.ListFeatureClasses() for fc in datasets: newName = fc.replace(' ','_') arcpy.Rename_management(fc, newName[:-4]) Note the [:-4], which I do to ...


1

You can do this with the "Select By Location" Tools. In ArcMap go to the meny "Selection" click "Select By Location". In the "Select By Location" window in "Target layers" chose your layer Building B. Then as "Source layer" you choose Building A. Then as "Spatial Selection method for target layer features" you choose an appropiate selection method. Why I ...


1

The point to line feature in arcgis requires data in a table to be ordered on the id for the group of points, i tried sorting the data but that didn't work still the point to line feature draws extra unnecessary lines but there was less extra liens this time,so my final solution was to use the point2one plugin in QGIS and that worked perfectly no extra ...


1

I eventually gave up trying to load the large files - it does not seem to be possible with any tool. The other side of the coin was that the features I did manage to load took over 1 hr to do a simple STIntersects query. Solution: I cut up the large shapefiles using ogr2ogr based on county geometries and then uploaded them and associated them with the ...



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