Tag Info

Hot answers tagged

13

ST_Union would work, but your line work is almost assuredly not clean. So the boundaries of your little thingies don't all perfectly like up. You can gently snap them to a grid to try and increase the odds that vertexes line up, but I bet that you'll still have a few cases that don't work. Either they will be beyond tolerance or, more likely, there will be ...


13

ST_MemUnion() will run a naive and slow memory friendly process. You can try that, if your problem is small enough, it might finish in a reasonable amount of time. You can also just break your problem into halves, then run the halves together. Since the resultants will have a lot fewer points than the inputs you might be able to fit the whole problem into ...


12

You can do this with the Summary Statistics (Analysis) tool. The case field parameter is what you use to "dissolve". From the above link: case_field [case_field,...] (Optional) The fields in the Input Table used to calculate statistics separately for each unique attribute value (or combination of attribute values when multiple fields are specified).


10

I might be missing something, but won't the basic Dissolve tool (somewhere in the data management toolbox) do this for you? No need to mess with any code as in artwork21's answer. Just open the dissolve tool, select your feature class, do not select any field to dissolve on, and then uncheck 'Create Multi-part poygons' otherwise all your poly's will be ...


8

@Tom Parker - MWrenn is correct. You have the option of selecting an attibute to dissolve on.(this will do an attribute dissolve) or no attribute (this will do a spatial dissolve). choose the statistics and any attributes you want to carry over. (this is not going to quite work like you want). Prior to doing the dissolve. create a new field and ...


8

There are a few reasons why this isn't working for you: Dissolve only works with a single input. You need to use a tool like Merge in order to dissolve two polygons. ArcGIS geoprocessing tools like Dissolve can run using arcpy geometries as inputs. However, your code does not pass arcpy geometry objects to the dissolve tool, it is entire layers/shapefiles. ...


6

Use the looping and variable value as shown in Aragon's answer with the FID field (this is the zero-based object ID field for shapefiles) as the select field as shown in L_Holcombe's answer to generate the where clause, and all should be good. To program in the total number of features use the Get Count tool and divide by 10 assigned to the variable. Will ...


6

Your problem is likely because of what you have included in the group by field. ST_UNION is an aggregate function, meaning that it is dissolving based on what you specify as the GROUP parameter. Here is what you entered: SELECT c.fid, ST_Union(c.boundaryshape) FROM c Group by c.fid,c.boundaryshape; According to this, you are grouping by your fid, which ...


5

This sounds like you need to look at the Summary Statistics tool which I find to be a bit of a Swiss Army Knife in that it comes with ArcView and can often be used in place of Frequency (that needs ArcInfo) and PULLITEMS (that needs ArcInfo Workstation:-) to reorder fields.


5

You can always use an open-source tool like QGIS to open your shapefile and merge features using the built-in "merge selected features" tool (just select features, click merge, select attributes to inherit to the new merged feature, done). This of course doesn't make much sense if we're talking about hundreds or thousands of merges. I myself was wondering ...


5

if you´re looking for something like this(labels denote area in sqkm): You can just intersect the Fishnet with the Polygon Layer.


4

You can create a model within Model Builder and export out the script, then copy and paste that script to a UIButtonControl within ArcMap vba. See script example below. Private Sub Dissolve_Click() ' Create the Geoprocessor object set gp = CreateObject("esriGeoprocessing.GPDispatch.1") ' Load required toolboxes... gp.AddToolbox ...


4

Is your PostGIS compiled against GEOS 3.1.0+? For that version, a much faster cascaded union was implemented, but if not found will use the older code which is orders of magnitude slower. Update: it looks as if your PostGIS is using the cascaded union approach, but the memory starvation is real. I'd try increasing the available memory to your Postgres ...


4

fTools is a python plugin for QGIS that can do it and you could hack it into fitting your needs. An easier alternative is the QGIS GRASS plugin, which includes v.dissolve, but then you're easier off scripting with GRASS directly. If you're not familiar with PostGIS, this may be a faster approach.


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

You can use enumarete function in python. myList = [] n = 99 for i, v in enumarete(myList): if i == n: print v 'first 100 item' #append your list if i > n and i < (n+2)*2: print v Or you can use this script from SO: def split_list(alist, wanted_parts=1): length = len(alist) return [ alist[i*length // wanted_parts: ...


4

You can do this in a few steps in ArcGIS. Perform a Select By Attribute to select all features with a specific land use type (e.g. residential). Perform a Select By Location on the previous selection with a 100m tolerance specified. Run the Dissolve tool on the final selection. This can be done manually if you only have a few land use types, or you could ...


4

You need to create an empty list, then append the features the new empty list. Rather than building the output location within the method you can create it in advance, and store it as a variable. Then you can use that same variable to append to the list. output_workspace = "C:/GIS Home/project_1" dissolveList = [] #empty list fcList = ...


4

The syntax is Dissolve_management (in_features, out_feature_class, {dissolve_field}, {statistics_fields}, {multi_part}, {unsplit_lines}) You need to specify the dissolve_field as the third parameter - here you've left it blank.


4

You can also try SQLite/Spatialite (comes with QGIS) or PostgreSQL/PostGIS where dissolve "a la ArcGIS" is done by the combination of the ST_Union() function on the geometry and a group by on the attribute to be summarized. Something like this: SELECT ST_Union(the_geom) INTO dissolved_polygons FROM your_table GROUP BY your_attribute;


4

Back in Arc/Info days (now called Workstation), INFO allowed you to "overdefine" aliases across multiple fields. If they weren't neighboring, then you'd need to generate a frequency table across the multiple fields, join to that table, and use the unique ID for your dissolve. The old way is still available, but the Dissolve tool under Geoprocessing (I'm ...


4

You could create a new attribute called "dissolve", and calculate it to be whatever unique value you wish to use for the dissolve. Eg, "for some specific countries" you would calculate dissolve to be "Country + State", while for the other countries you would calculate dissolve to be simply "Country".


3

ST_Collect function is an "aggregate" function in the terminology of PostgreSQL "SELECT ST_Collect(GEOM) FROM GEOMTABLE GROUP BY ATTRCOLUMN" will return a separate GEOMETRYCOLLECTION for each distinct value of ATTRCOLUM http://postgis.net/docs/ST_Collect.html Note: ST_Collect is much faster than ST_Union


3

Firstly, welcome to the site @MattWalsh! You've got the right idea with iterating through a loop and creating a list of output buffers to merge and dissolve together. I'm going to guess you want a separate output for each different buffer level, but hopefully this will be easy to change later if you want. Also I'm assuming the buffers are only temporary so ...


3

It looks as though you are using the USGDR data (BLM) BTW: Dissolve is what you would use instead of merge. the python part is not my thing. The dissolve command with the first division identifier column as the dissolve field should get you what you want First you want to create a new field to hold the qtr section value for each qtr qtr by using ... right ...


3

Assuming you are getting the "Invalid Topology" error you need to make sure that all geometry in this feature class is correct. Make sure the layer is in a File Geodatabase Feature Class format. Run the "Repair Geometry" then try DISSOLVE again. Dissolve can create VERY large features from a large amount of small features and it can be a very memory ...


3

In PostGIS, there is a dedicated function for merging lines ST_LineMerge - Returns a (set of) LineString(s) formed by sewing together a MULTILINESTRING. http://www.postgis.org/docs/ST_LineMerge.html


3

Perhaps something simple would work? Assuming "gid" is a column with consecutive integers: arcpy.Select_analysis("in_features", "out_features", '"gid" < 400') arcpy.Select_analysis("in_features", "out_features", '"gid" < 800 AND "gid" >= 400') etc. I haven't tried this, but it should work. ArcGIS SQL expression reference: ...


3

It looks like GRASS does in fact treat the result as a multipolygon, although QGIS displays it as separate features. I determined this by calculating the area on the feature(s) and they all came out to be the same for each DISS value. This is also hinted at in this post, where Radim responds: The multi features are kept in GRASS but in QGIS represented ...


3

I would try this as a test, if it gives you a good result, put it into a SearchCursor (arcpy or arcpy.da) that runs through all owners: Select out the parcels for a single owner into a new feature class Buffer those polygons by 100 ft (51 ft, or 50.1 ft, may be better) Dissolve by owner to merge overlapping buffers (or do the dissolve as part of Buffer) ...



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