Select to view content in your preferred language

Merging shapes within a feature

1532
6
11-25-2016 04:26 AM
TheoFaull
Deactivated User

Hi all,

I have a polygon shapefile with 1800 records. I want to slim this down by merging together records with either:

a) duplicate/matching area sizes in the Area field

or

b) matching first 6 letters of a reference ID field.

So below, the 4 'Armes Court' shapes would combine into one and same with the 'Avon Court' shapes etc etc...

There are too many records to go manually merging them togther.

Thanks.

also, why can't i publish this question in a general 'GIS' location? When I click browse places, all the cateogories are really specific. I've had to choose python as perhaps the solution to my question is python...? who knows...

Tags (2)
0 Kudos
6 Replies
NeilAyres
MVP Alum

Isn't dissolve what you want to do?

You may have to create a new dissolve item in your attribute table first, then copy over those first 6 characters across.

dissolve

TheoFaull
Deactivated User

I've made a new text field to copy across the first 6 characters into, do you know what vb/python code I should use in field calculator to only take the FIRST 6 characters over? or copy it all then DELETE the last 4 numbers from the right?

0 Kudos
LukeWebb
Frequent Contributor

Dissolve wont work as standard on the 2 fields as you require, however do you really need to merge where the areas are the same also, is the first 6 characters of the uniqueID not enough?

(Your rows for "Armes court" will not dissolve into 1 feature as they have different areas)

Anyways, if just the uniqueIDs is just enough, the workflow is:

1)  Calculate field using expression:

left( [QL_PROPID], 6)

2) Dissolve using this new field as the dissolve field.

NeilAyres
MVP Alum

Or if you wanted the python version. Check the python parser radio button first.

!QL_PROPID![:6]
TheoFaull
Deactivated User

Thanks LukeW

Yes I didn't realise there were two different areas for armes court. I guess what I only want, is to dissolve based on the Unique ID field.

I'll create a new text field to transfer the first 6 characters over. Then I'll dissolve.

I always get confused with the 'left' and 'right' in vb scripts. And whether it deletes or keeps the specified characters.

Thanks.

0 Kudos
DanPatterson_Retired
MVP Emeritus

Theo...

Moved to Managing Data‌ data because..

  • it isn't GIS specific
  • the question is about data formatting and structuring
  • the solution is language agnostic or could be solved using one or more languages

The GeoNet Community Structure may help to provide a more categorized perspective.