# Tag Info

28

If you have a Windows computer, you can use good 'ol CMD.EXE with a few esoteric for-loops. Make sure you do this in a "contained" directory with only the shp/sql files that you need to load. First step, create the SQL loader files (I also assumed you have Lat/Long WGS84 data with 4326 .. update this to your SRS): for %f in (*shp) do shp2pgsql -s 4326 %f ...

20

If want to stick to a GUI then the newer version of pgAdmin has Shapefile Loader that can be used as a bulk load

13

The following script clips polygon watersheds to polygon county boundaries, naming each output featureclass something like HspWBD_HU12_county name. Tested and it works. Make sure your values in the NAME field have no special characters or spaces (simple Python string methods can clean that up for you). import arcpy arcpy.env.workspace = r'D:\Projects\GDBs\...

13

Recent versions of gdal_translate have support for KML Superoverlay. Although it is not yet documented on the GDAL website the following can be used: gdal_translate.exe -of KMLSUPEROVERLAY c:\in.tif c:\out.kmz -co FORMAT=JPEG This will save a tiled version in a kmz file using jpeg compression. On windows you can automate using forfiles /m *.tif /c "cmd /...

11

ModelBuilder functions differently than batch processing in ArcGIS. Typically, you use iterators to loop through individual files rather than a spreadsheet-type list of files and actions, as in batch mode. The following is an example of the type of model you would need to loop through a workspace containing rasters in order to clip them to study area bound....

8

Two possibilities: Use wildcards to process all files in a directory: FOR %%F in (D:\Karten\shp\Gemeinden\*.shp) DO ogr2ogr -t_srs EPSG:31466 D:\Karten\shp\neu\%%~nxF %%F Use quotation marks around path and filename: ogr2ogr -t_srs EPSG:31466 "D:\Karten\shp\Test 1.shp" "D:\Karten\shp\Test 2.shp" EDIT This one works for me: for /R %%F in (*.shp) do ...

8

What you need is the QGIS plugin Load Them All. Apart from loading files from several directories at once, you can: Reflect the directory structure in the QGIS Table of Contents (by means of nested layer groups). Apply alphanumeric filters so that you just load layers that match your filter (think of regular expressions). Load only certain geometry or ...

7

I don't have any specific links for you, but I think that you should look into the tools that already exist in ArcGIS Desktop. Have you looked into using Geoprocessing tools & models via python? A good place to start would be to make your Geoprocessing model & then export the model to Python. You can get more information here:http://help.arcgis.com/...

7

I think that all of listed by you software allow to execute batch converting in some way. ArcGIS I can explain how is it possible to perform in ArcGIS. Converting of one raster JPEG2000 -> GeoTiff can be done using tool Raster To Other Format (Conversion). Don't forget to setup appropriate raster storage settings in Environment variables when running ...

7

In your case (jpg rasters and exact same extent for all rasters) the Warp From File tool is just fine. If you haven't saved a link file yet you should do this first: Georeference one raster in ArcMap, click the View Link Table button and save the links to a text file using the Save button: Then there are different options: Batch: You can use the Warp ...

7

You can accomplish this in batch mode, in ModelBuilder and with Python. Batch Mode: First delete your old XY fields using Delete Fields in batch mode. Right click on the tool and select "batch". Drag the files you want to process into the dialog box. The rows will automatically update to include all of the files you are processing. Choose the XY ...

7

Try this Frida: Create a folder to store your Shapefiles there (e.g., I've created the folder /tmp/data/, I use GNU/Linux). In QGIS, open the QGIS Python console. Write the following line, editing the right hand side to match the full path to your folder (make sure you include the trailing slash/backslash): myDir = '/tmp/data/' Press Enter. Copy the ...

7

API conditions constantly change, but this should work right now. OSM: devtools::install_github("hrbrmstr/nominatim") library(nominatim) b1 <- osm_geocode("Berlin, Germany") b1[c("lat", "lon")] Yahoo: devtools::install_github("trestletech/rydn") library(rydn) options(RYDN_KEY="yourAPIkey", RYDN_SECRET="yourSecret") b2 <- find_place("Berlin, ...

6

I'm a little bit late, but hope it helps. Tuts and books If you want something learn about ogr, gdal, python and postGIS you can look at first on these pages and book. Geoprocessing with Python using Open Source GIS http://www.gis.usu.edu/~chrisg/python/ ogr http://www.gdal.org/ogr/ ogr2ogr - cheatsheet http://www.bostongis.com/?content_name=...

6

It isn't nice code, but for your specific circumstance, here is some python that should save typing them out by hand: f = open('list.txt', 'r') lines = f.readlines() for line in lines: lineparts = line.split(' ') outfile = open(lineparts[0], 'w') for i in range(1, 4): outfile.write(lineparts[i] + '\n') outfile.write(lineparts[4] + ...

5

Export Map Document to PDF is now included in the arcpy.mapping sample script tools Source Code is available to Automate/Batch MXD for Export to PDF.

5

As you use ArcGIS 10, i would use modelbuilder with builtin tool: Iteration Feature Selection to perform this task. See the pseudo-model in the picture. it does not need to know python scritping at all.

5

Change your block: #Set the input datasets inputs = ConversionUtils.gp.GetParameterAsText(0) # The list is split by semicolons ";" inputs = ConversionUtils.SplitMultiInputs(inputs) With: inputs = [item.replace('\n', '') for item in open(filename).readlines()] Where filename is your file with the list of SHP ("Text File Sample").

5

Your script is trying to save each input to the same output shapefile. Since it is not set to overwrite existing data, it works the first time but not any time after that. The relevant line is: outdata=os.path.normpath(ConversionUtils.gp.GetParameterAsText(1)+path) To fix it, you will need to incorporate the outdata= line into your for input in inputs: ...

5

Here is a solution which is running quite fast (around 15 seconds for a 5 million random points which i created for Texas State). I normalized the multipoint input and it is giving satisfactory output. I am using Topology Framework .NET. It is similar to NetTopologySuite. Maybe you can do the same with NetTopologySuite as well. My solution (console ...

5

outRaster = os.path.join(outFolder, rasterFile + "bmp") #THIS LINE?? should be outRaster = os.path.join(outFolder, rasterFile + ".bmp") #THIS LINE?? instead of using glob perhaps use the inbuilt arcpy.ListRasters: rasterpath = r"C:\VMshared\small_example_valley2\snowdepthout" outFolder = r"C:\VMshared\small_example_valley2\snowrast" arcpy.env....

5

This uses multiple shape features in a single shapefile (based on your code snippet). If you have a single shape feature in multiple shapefiles I have added code for that further down. The following update on your script will loop through each feature in your polygon shapefile (regardless of number of features), and clip each raster it finds using List ...

4

I have found the following utility to be quite helpful. THE LOST CARTOGRAPHER It was written by Ben Slater. In this blog post, he has given the code as well as the executable for Batch Printing ArcMap MXD Documents Edit: Added more information about the Utility, as per Matt Wilkie's suggestion

4

Many people have asked about this. At least one request (NIM013677) has been rejected with the status "as designed." The reason given is: Because when using the script version, the tool cannot know whether the target is a dataset or a feature class. It is designed to not support a feature dataset. Std Disclaimer: I work at Esri, but not on the ...

4

If you right click the Layer To KML tool in the ArcToolbox, there is a batch option. This is common for most of the geoprocessing tools for ArcGIS 10. You could also use the Map To KML tool, which creates a kmz of all the layers loaded within a saved mxd.

4

Do you need to keep all of your intermediate intersects (ie- temp_poly0, temp_poly1)? If not, you will find that sending results to "in_memory" workspace will not only be easier to manage (all the data is cleaned up from memory on exit of the program, or you could just delete it from memory with arcpy.Delete to clear the memory space if you need to), you ...

4

The Model Only Tool called Calculate Value can be run in Batch. To prove this to myself I did the following: Create a test feature class, add one feature and an empty field to it - I used Short Integer Write first tiny model with Iterator called For and Copy Features and run it to create five copies of the test feature class called test1, test2, ..., ...

4

some relevant functionality below. all of which is new at 10.1. with projected coordinate system, you have access to the GCS object which is where the datum info lives. if you're working with a GCS object already, just access the relevant datum properties (datumName, datumCode) directly. from_sr = arcpy.SpatialReference('NAD 1983 HARN UTM Zone 11N') to_sr =...

4

AWK is perhaps the most effective tool for such text conversion (although if you're familiar with Perl you might prefer it, out of habit): it was designed for exactly this kind of one-off quick reformatting work. Here is the full AWK code to perform the requested operation on the input specified: BEGIN {OFS="\n"} {print $2,$3, $4,$5 $6,$7, $8 >$1} ...

4

I guess you might want to append (>>) the projection to list.txt and not assign (>), otherwise list.txt will be overwritten at each iteration of your for loop. For /R %f in (*.tab) do ogrinfo -al -so %~dpnxf >> list.txt

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