Hexagon Geospatial
MENU

ERDAS IMAGINE

Discuss and share topics of interest using ERDAS IMAGINE the world’s leading geospatial data authoring system.
Showing results for 
Search instead for 
Do you mean 
Reply
Occasional Contributor
Posts: 20
Registered: ‎06-12-2016

Erdas IMAGINE Feature clipping - Spatial Model

[ Edited ]

Hello, 

 

I am working at a spatial model in which I have to clip a feature by a different feature (mask) (Image 1.png) . The two features have the same coordinate system (WGS84, although they do not represent some features on the Earth surface), their overlapping is tested in Erdas Imagine and also in QGIS 3.2.0 and ArcMap 10.2.2 (where, when inserted, the warning message (Image 2.png) appears. 

 

My question is: Which spatial model operator do you recommend for this workflow ?: I already used:

  • Mask Features - returns the same feature layer as the input layer (FeaturesIn)
  • Intersect Features - the spatial relationship options list does not contain a clip option (this operator was tested with the Contained by option and the result consisted of contained features by the mask layer - this is not good for my workflow, returns only the contained features, it does not clip the input feature)
  • Filter by Geometries - Returns an error: 

22/08/18 14:36:36 SessionMgr(1584): ERROR: #1985 from HexGeo:Smiley FrustratedpatialModeler:Smiley Surprisedperator:Smiley FrustratedetErrorMessage
22/08/18 14:36:36 SessionMgr(1584): ERROR: Spatial Model failed in Filter By Geometries. The error was "HexGeo:Smiley FrustratedpatialModelerFeatures::FeatureAccessor::Iterator<class boost::shared_ptr<class HexGeo:Smiley FrustratedpatialModelerFeatures::FeatureAccessor>,class boost
::shared_ptr<class HexGeo:Smiley FrustratedpatialModelerFeatures::Feature> >::dereference failed
22/08/18 14:36:36 Iterator not dereferencable".

 

Thank you for your support, looking forward to a solution for this workflow. ***If needed, I can also attach the *.gmdx file.

 

Best regards, 

Marian

Highlighted
Staff
Posts: 126
Registered: ‎07-04-2016

Re: Erdas IMAGINE Feature clipping - Spatial Model

Dear Marian,

 

If I understand you correctly, Mask operator will do the opposite of what you need, it will clear all features that fall within the border polygon.

 

If your idea is not just pick the feature 1, that is inside of feature 2, but to cut out the parts that falls out of the edges of feature 2, so filter operators will not help. Just FYI, the specified error is fixed in ERDAS IMAGINE 2018 Update 1

 

You can work around this by converting your features to rasters and then do subset for rasters. I am not sure if that is the only option, but it worked for me. It would look something like below (model also attached):

 

2018-08-23 14_04_44-Start.png

 

 

In this example model, it converts both features to rasters, does a subset, then converts back to features. Afterward, as an example, I have shown how to add back one attribute from the original shapefile.

If you have multiple polygons and you want to subset each to a separate shapefile an Iterator operator should be used.

 

Kind Regards,
Marina Vardovska
Hexagon Geospatial Support
Technical Evangelist
Technical Evangelist
Posts: 318
Registered: ‎02-03-2016

Re: Erdas IMAGINE Feature clipping - Spatial Model

As indicated by Marina, masking removes what is inside the "fence", and clipping removes what is outside the "fence".  So you need a Clip Features operator.  This is on our roadmap, but not very high because (1) we are focused first on harvesting functionality from GeoMedia, and GeoMedia doesn't have a clip capability like this; (2) we haven't had requests for it.  I've noted your interest :-).

 

In the meantime, and I emphasize that I have not tested this so it's just a point of exploration, go back to the Intersect Features operator and use the Touch spatial relationship, and putting your clip boundary in as FeaturesIn2.  This should create output features where the input features intersect the clip feature boundary, but will not create such features outside the clip boundary.  See if that does what you need.  - Hal

Occasional Contributor
Posts: 20
Registered: ‎06-12-2016

Re: Erdas IMAGINE Feature clipping - Spatial Model

[ Edited ]

Hi Hal, Marina,

 

Thanks a lot for the help, I managed to solve the issue finally, I used the mask features and I obtained the difference between my grid and the features, so ultimately I had to substract the free space area from the grid total area and obtained the occupied area. My spatial model looks like this: 

 

SM_clipping.png

I was also thinking about doing the operations on the rasters, but I managed to solve it this way.

 

Thanks a lot and wish you all a great week!

Do you need immediate support?
If you encounter a critical issue and need immediate assistance please submit a Service Request through our Support Portal.