Unable to reproject OGR layers on-the-fly

Description

Even with the following global settings: AllowProjectionMismatch = true, and ReprojectLayersOnAdding = true, I was unable to load layers from an OGR datasource when the layer projection differed from the current map projection. File-based Shapefiles were able to reproject, but not Shapefiles created from OGR layers via GetBuffer.

Environment

None

Activity

Show:
Jerry Faust
November 9, 2018, 1:32 AM
Edited

Two things were preventing the OGR layers from reprojecting.
1. A recent change suggested by CLang resulted in all in-memory shapefiles failing a validation call. This included OGR layers, where are effectively treated as in-memory shapefiles. This small change has been undone.
2. Having made the change to allow OGR layers to pass validation, a memory access violation exception was being raised in an internal Map ReprojectLayer method. This exception only occurred for OGR layers and not Shapefiles, and was a result of one-too-many COM Release calls being made on the pre-projected shapefile.

I should note that the recent CLang change was never released, and so it only affected the 'develop' branch for a short period of time.

Assignee

Jerry Faust

Reporter

Jerry Faust

Labels

Fix versions

Priority

Medium
Configure