ThinkGeo.com    |     Documentation    |     Premium Support

Handling track + edit layers when map is projected

A follow-up question to What properties need to be set when changing projections?

What is the proper way to use track and edit layers when drawing/editing features when other layers are projected? I noticed if I set the projectionconverter on the tracklayer to match what the other layers have, the feature does not appear while drawing. If I don’t set anything, I see the “track” fine, but I’m unsure what projection the internal features are in?

For instance, say I have the mapunit set to meters, and all my static layers have an internal wgs84 and external 3857. If I want to draw a feature using the tracklayer and then move it to one of the static layers, what would I have to project the feature to?

Just a reminder this is for v13.1.2, not on 14 yet.

Thanks!

You don’t need to set a ProjectionConverter for the TrackOverlay.TrackLayer , but you do need to reproject the tracked features to the correct internal projection before saving them back to the target layer.

For example, say you have two layers — layer 1 has internal Projection A and layer 2 has Projection B, while your map is in Projection C.
That means:

  • Layer 1 uses an A → C ProjectionConverter
  • Layer 2 uses a B → C ProjectionConverter

Now, when you draw something on the map, the features in TrackLayer will be in Projection C (the same as the map). If you want to save those features to Layer 2 , you should reproject the tracked features from Projection C → Projection B, and then save them to Layer 2. (Do not set the TrackLayer’s own ProjectionConverter — just convert the features before saving.)

In short, the TrackLayer always follows the map’s projection.
When saving tracked features, reproject them to match the target layer’s internal projection.

Thanks for the response Ben. You mention the tracklayer follows the map’s projection, but here Base map + projection questions it says the map itself doesn’t have a projection, just the mapunit. So for example if I have my map unit set to meters, I can see the trackshape is in meters, but not the projection.

Good catch!

The MapView itself doesn’t actually have a projection property, just the MapUnit . What I meant was more of the idea of the projection the map is showing everything in.

For example, if I have Japan data in its local UTM and Australia data in a different UTM zone, I can’t just display them together unless I convert both to the same projection — say, Spherical Mercator. So when I said “map’s projection,” I meant the projection everything gets converted into for display (Spherical Mercator). The map control doesn’t store it directly, but it’s the projection your layers are being shown in on screen.

1 Like

Thanks Ben! Just curious, could you go into details a bit about how the tracklayer determines the projection everything is in? Like does it just check the first layer’s external projection?

Seems to be working good though!

In fact, tracklayer holds the data, but it has no idea about the projection of the data. The developer needs to find out the right projection (use the first layer’s external projection for example) and reproject the data properly.