Tag Info

Hot answers tagged

16

From the GDAL manual: A merge of two shapefiles 'file1.shp' and 'file2.shp' into a new file 'file_merged.shp' is performed like this: % ogr2ogr file_merged.shp file1.shp % ogr2ogr -update -append file_merged.shp file2.shp -nln file_merged The second command is opening file_merged.shp in update mode, and trying to find existing layers and append the ...


13

Similar to the merge function is building a virtual raster: Raster-> Miscellaneous-> Build Virtual Raster (Catalog) This leverages the GDAL Virtual format (.vrt), which is an XML file that defines how the files are positioned, etc. Virtual rasters can save considerable disk space, and QGIS 'sees' them as a single file. This is very useful for ...


11

You can use Table Manager Plugin in QGIS to rename, delete and sort table attributes. You can try harmonize the shapefiles structure. There is one limitation, Table manager won't be able to change attribute types. If you have an attribute that is a "text" in one shapefile and a "integer" in the other, you have to create a temporary attribute and convert the ...


9

(Pre-flight-check: are attributes identical in all original tables? Is the geometry type exactly the same in all tables?) You can either create the (empty) table first, then use INSERT INTO...SELECT... FROM to get all the data from each of the original tables into the merged one. Create the new table from one big UNION statement. For 1 it might go: ...


7

This is a very simplistic test, but I think it shows conclusively that Merge+Dissolve is about 3 times quicker than Union+Dissolve on this dataset, and I believe that as more complex data is thrown at it, the difference will only widen. import arcpy,time if arcpy.Exists("C:/temp/test.gdb"): arcpy.Delete_management("C:/temp/test.gdb") ...


7

It would be easier with arcpy. for i in range(10000): pol_list = [] for j in range(30): pol_list.append("a" + str(i*30 + j + 1) + ".shp") arcpy.Merge_management(pol_list, "b" + str(i+1) + ".shp") EDIT: for a feature class inside a geodatabase, you don't need the + ".shp" anymore, and you can define the workspace using : ...


6

If the LineString is simply to be subdivided at a position closest to the given Point, you could do what you want with this (splits LineString at closest Point to given Point and remerges the two segements afterwards) SELECT ST_AsText( ST_LineMerge( ST_Union( ST_Line_Substring(line, 0, ST_Line_Locate_Point(line, point)), ...


6

Well, QGIS is not that good in creating of continuous rasters if that's what you want. Nevertheless it all depends on precision you wish to have in the end. If you wish to trade precision for swiftness - merge them all in GIMP and then georeference resulting image. But be aware that every modification of the raster increases the errors. So if you want to ...


5

Fusion Tables, Google Visualization API and VizMaps with Google Maps API may be what you are looking for: Fusion Tables: "Google Fusion Tables lets you store, share, query, and visualize data tables. It offers a REST API to manage tables, info window templates, and styles. The query endpoint offers allows you to manage data rows (insert/update/delete), and ...


5

The unionSpatialPolygons function in the maptools package does this. You supply to it a SpatialPolygons and a vector which indicates which polygons (zip codes, in your example) belong to which aggregated polygon (sales areas). EDIT: The help page on unionSpatialPolygons has a good example of creating a grouping/indexing vector. It using counties in North ...


5

The Reshape Feature Tool can be helpful for this job. Draw the new common border of the polygons (here in red color):


5

Start by converting them to raster formats (assuming they are in DEM format to start with): then use the 'Mosaic to New Raster' tool to combine the different rasters into a single one: Make sure that they are in the same units before mosaicing them or they will look really odd when you stitch them together. That's the basic approach I use, I'm assuming ...


5

You say that you are using a "site license" but not whether your license level of ArcGIS for Desktop is Basic, Standard or Advanced. If it is Advanced then Union will allow you to use more than two input feature classes. If it is Basic or Standard then you will need to do pair-wise Unions and then Union the results instead. To have the original FID for ...


4

Merge takes both geometry and attributes and combines (merges) the entire dataset into a new feature dataset. Append is good way to join extra data to an existing dataset - it can have options to control subtypes of features being appended. http://resources.arcgis.com/en/help/main/10.1/index.html#//001700000055000000 The key difference is If the Schema ...


4

I would advise against celenius' suggestion (with respect) for the very reason he mentions plus the 'interesting' results you can get in some systems where some rasters have NoData (NoData is not the same thing as zero). Use the merge tool provided (its a lot easier and safer): Raster->miscelaneous->merge This essentially does the same thing as the GDAL ...


4

No need to turn the raster into polygons. You'll want to do it in multiple passes. First you want to resample the lower resolution dataset to as close as you can get and a multiple of the higher resolution dataset using bilinear interpolation which should get you a better looking resampling. Then do the merge as normal using your nearest neighbor (which I ...


4

In GIS context, the better is organize your data in a database (!). Then, many kinds of operations will be simple. With PostGIS (using PostgreSQL as database) the command that solves your problem is SELECT ST_Collect(geom) FROM your30000features_table; And the commands are standard, see standard OGC functions ST_Collect and ST_Union. Using as input ...


4

i wrote some downloadable code for that. A simple python program for combine shapefiles in many ways: http://furiousgis.blogspot.it/2012/05/python-shapefile-merger-utility.html By default performs the dbf schemes union and it adds an attribute filled with the source shapefile name, so you can recognize records. This is the commandline for your needs: ...


4

Using GDAL >= 1.10.0 and its OGR Virtual Format, we can write a VRT file named, for example, merge.vrt (see Example: Union layer (GDAL >= 1.10.0)): <OGRVRTDataSource> <OGRVRTUnionLayer name="unionLayer"> <OGRVRTLayer name="source1"> <SrcDataSource>source1.shp</SrcDataSource> </OGRVRTLayer> ...


4

Consider the following workflow: Add Field to polygon feature class Calculate field (See attached Code Block) Dissolve based on your new reclassified field values (i.e. 1 or 2) Hopefully this simplified approach, or a variation of it, will work for you.


4

Something like this (untested) should put you on the right track: import os import arcpy import fnmatch def listCountyPOIs(county_folder): pois = [] for dirpath, dirnames, filenames in os.walk(county_folder): for filename in filenames: fullpath = os.path.join(dirpath, filename) if fnmatch.fnmatch(fullpath, ...


4

You're looking for the Dissolve tool - if all of your polygons are in the same featureclass/layer just run it and then use the Field Calculator to determine the area. If your polygons are in different featureclasses, run the Merge or Append tool first.


4

Sounds like it might be more useful to use the 'Append' tool in the Data Management toolbox, that will let you specify multiple inputs to append to an existing feature class.


4

First, you are using R. R Studio is just an IDE for R so in the future please make this an R question. I will warn you that working with HDF files in R is a pain. In theory GDAL supports HDF5 so one could use readGDAL in the rgdal package. Depending on the source of the data readGDAL has a high fail rate making it less than reliable. Historically, there ...


4

You can prefix all shapefiles with the folder that they are found within. A simple model as shown below can achieve this. So your initial folder file structure may be this: After running this model all shapefile will be prefixed with the folder they they are found within (e.g. T2_myData.shp). Your data then has unique names so they will be valid input ...


4

OK here's the answer. I have discovered the processing toolbox from which there was a simple solution: As per http://qgis.org/de/docs/user_manual/processing/console.html From the console you can get a list of all the algorithms available which contain the word "merge" by typing: import processing processing.alglist("merge") Then you could find out how to ...


4

Try this: import arcpy from arcpy import env # two traps here for beginners, well spotted! env.workspace = "G:/US county_Climate Hazard models/NWS_County/SUMCounty_NWS_new_frq.gdb" env.overwriteOutput = True outTable = "C:/Documents/ArcGIS/Default.gdb/Merge_sum_freq" # Clear the way, just to be sure if arcpy.Exists(outTable): try: ...


4

I don't know if its possible to do this within QGIS at this moment with a tool like ESRI's. I'd recommend using a database for this because it's easier to manage. In the case of a database, you would simply use an APPEND or an equivalent SQL command (APPEND is MS Access syntax, the ANSI SQL equivalent is INSERT INTO) to custom load your data into your ...


3

In the past I've had this problem too. It seemed to come and go with different versions of QGIS and I never found a reason for this. You can work around the problem by making a virtual raster from your raster images. Raster -> Miscellaneous -> Build Virtual Raster (Catalog). This will build a *.vrt file that you can treat exactly as if it was a merged ...


3

I've done something similar lately using an update cursor and the xlrd-library with python. The script updates some existing records with the data from the excel sheet. Hopefully this will be of some use for someone else. import xlrd import sys, os # Geoprocessor-object (ArcMap 9.1 and older) try: import win32com.client gp = ...



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