Index for singlepart geometry/copy geometry

Added by Wim Looijen about 1 year ago

Dear all,

I have a shapefile with singlepart geometry. Each geometrical object has an ID. Several singleparts have the same ID as multiple singleparts form one multipart. However I need to make a unique ID for each singlepart. How can I do this?

Example: polygons all have ID 1 but I want to transform the first polygon with ID 1 to ID 1.1 (or similar) the second polygon with ID 1 to ID 1.2 etc.

Furthermore I have a shapefile with geometry that needs to copied as one geometry covers two classes and I need to create one geometry for each class. How can I do this?

Example: one polygon contains the class VR+HR but I want to separate these into two polygons, one with class VR and one with class HR

Cheers,
Wim Looijen


Replies (2)

RE: Index for singlepart geometry/copy geometry - Added by Thorsten Reitz about 1 year ago

Dear Wim,

Regarding your first case: Do you plan to generate separate features for each polygon in each feature of the single parts (features in the source data set), or do you plan to combine objects first, and then to split out each simple polygon as a separate feature? Or do you mean that you'd need Ids on individual Geometries(not features)?

In the second case, you would create two features from one feature. You can do so by defining two condition contexts on your shapefile feature type - one with HR and one with VR as search string. You then retype from each of these to the target type.

All the best,
Thorsten

RE: Index for singlepart geometry/copy geometry - Added by Wim Looijen about 1 year ago

Hi Thorsten,

In the first case I would like to generate separate ID's for each polygon but starting from the "masterID". There are 20 masterID's and 227 polygons. The example used previously: masterID = 1, uniqueID is 1.1 tot 1.35 (35 polygons with masterID 1).

We will try the second case.

Best regards,

Wim

(1-2/2)