08-22-2018 04:57 AM - edited 08-22-2018 04:59 AM
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:
22/08/18 14:36:36 SessionMgr(1584): ERROR: #1985 from HexGeo:patialModeler:perator:etErrorMessage
22/08/18 14:36:36 SessionMgr(1584): ERROR: Spatial Model failed in Filter By Geometries. The error was "HexGeo:patialModelerFeatures::FeatureAccessor::Iterator<class boost::shared_ptr<class HexGeo:patialModelerFeatures::FeatureAccessor>,class boost
::shared_ptr<class HexGeo:patialModelerFeatures::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.
08-23-2018 05:44 AM
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):
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.
08-23-2018 09:06 AM
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
09-17-2018 06:15 AM - edited 09-17-2018 06:48 AM
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:
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!