Global Mapper v25.0

Cropping with holes, and masking data

tjhb
tjhb Global Mapper UserTrusted User
edited October 2010 in Suggestion Box
Currently we can use one or more areas to crop output data, both in the GUI and in the scripting environment.

We can specify whether to crop to a bounding box of all areas, or to the areas themselves, either all together or separately. Which is great.

There are two things which I think we can't do, which are closely related.

(1) If a cropping area has a hole in it, the hole is ignored, so that data falling "outside" the cropping area, but within its hole, is included in the export. Would it slow things down enormously to have holes excluded from the cropping area?

(2) It would be nice to be able to specify area(s) of data to exclude, or mask, as well as or instead or area(s) to include in the crop. In the GUI, this would probably have to implemented as an either-or option, since cropping is based on selection, which is a Boolean property. In the scripting environment, it might be possible to allow both (say) a POLYGON_MASK_FILE alongside the POLYGON_CROP_FILE option we have now. The two could work together (with the mask file taking precedence in case of overlap).

If (2) were implemented then then it would be possible to take care of (1) explicitly (at least for scripting) by replacing the hole areas with a separate masking file.

Best regards,
Tim

Comments

  • tjhb
    tjhb Global Mapper User Trusted User
    edited October 2010
    Further to (1).

    I haven't tested what currently happens with islands within holes, but I assume they count as part of the cropping area as well. If holes in cropping areas were excluded, then islands within holes (and holes within the islands, and so on) would need to be dealt with explcitly. Which might be slow.
  • global_mapper
    global_mapper Administrator
    edited October 2010
    Are you exporting to vector or raster formats? I would expect holes in crop areas to already be used when exporting to a new raster format file, is this not what you are seeing?

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • tjhb
    tjhb Global Mapper User Trusted User
    edited October 2010
    Vector in the present case. I should have tested with raster data too. I will.
  • global_mapper
    global_mapper Administrator
    edited October 2010
    Ah yes, our library for cropping vector features to polygons currently doesn't have real direct support for cropping to polygons with holes in them, so the holes are ignored when cropping on export. Raster exports do support cropping with holes though as that just adds more point-in-polygon tests to the operation.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • tjhb
    tjhb Global Mapper User Trusted User
    edited October 2010
    Not much interest in adding a POLYGON_MASK_FILE option to the scripting interface? I wonder whether others would find that useful too.
  • global_mapper
    global_mapper Administrator
    edited October 2010
    It would basically run into the same problem as cropping to areas with holes does since that's what the mask would basically be. I think it would be better to just support cropping to areas with holes in them rather than add another parameter to achieve the same thing.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • tjhb
    tjhb Global Mapper User Trusted User
    edited October 2010
    Yes, that would be better, if the library is updated at some point.