Hi,

There have been as far as I see two different ideas for storing the
imagery calibration data (offsets / control points) in a global
database instead of local bookmarks.  One was Dermot McNally's
proposal to store the outlines of areas with constant offset in the
osm database, which hasn't yet been implemented but Dermot says he's
on it now.  The second, which I just learnt about is Komяpa's offsets
server.  The latter stores offsets at discrete points, which is the
approach I was going to take myself.  I've set up a simple server [1]
which accepts "create", "modify", "delete" calls for control points,
and a "get control points affecting a bbox" call, which would be used
by editors to warp the imagery as it's being displayed.  I now see
that the offset server works similarly and the main thing it lacks is
a good user interface to interact with the servers in the editors (I'm
sending this to josm-dev but Potlatch authors are also on this list
too)

Next thing I was going to do was to try to make josm use the server
and then propose a patch, but I found the offset server support
already implemented so I decided to ask what everyone thinks about
this approach.  Specifically the UI may be tricky to get right but it
would be useful to come up with one that's good enough to be enabled
by default -- last week an osm newbie told me the map data in his area
was "completely wrong" which he judged from seeing the data against
the Bing imagery, which was about 100m out.

To keep the UI simple my idea was that the imagery would be warped in
the editor using control points loaded from an external DB.  Each
point of an image would be moved using the offset values from the
three or four nearest control points, where available.  There would be
a set maximum radius a CP can affect, which could be, say, 6km.  If
there's only a single control point in some place the pixels at that
place would be offset by the amount stored for that CP and linearly
less with growing distance from the CP, down to zero offset at 6km.

When you add an imagery layer in JOSM, a request is made to the offset
server for all control points in the visible bbox + a 20km buffer (for
example) for all zoom levels, unless that option was diabled in the
preferences.  In the mean time imagery is loaded with no offset.  If
the server returns any control points, the view of the imagery is
adjusted using those points.  If the user later adjusts the imagery
using the "Drag to move the picture" action, a new control point is
added locally.  To upload local control points to the server, user
clicks the imagery layer in the "Layers" panel with right mouse button
and selects "Upload <N> control points to offset server" from local
menu.  The option is only available if the offset server was not
disabled in the preferences.

Since control points have a min and max zoom level, the editor or the
server need to decide betweem them which zoom levels a GCP applies to.
 Current idea is:

* for the "Bing" layer, when a new CP is created in the editor, it
applies to the all zoom levels that are covered by the same imagery
source.  The imagery sources are already available from the Bing API
because it is queried for the attribution labels.

* for "Yahoo" layers, CPs apply to all zoom levels.

* for any other layers, a new CP applies only to the current zoom level.

On IRC it was also noted that it would be easy for the offset server
to download the tiles for a TMS layer at successive zoom levels and
compare the tile contents to see how far they correlate.  I'm not
going to implement that at this point ;)

All of the control points would be visible and further editable
through a website to avoid complicating the josm UI.

What are other people's ideas?

Cheers

1. The control points server works at
http://openstreetmap.pl/alignator and the supported requests are the
following, reponses are JSON.

* 
/create/<layer-name>/<layer-lat>,<layer-lon>/<min_zoom>/<max_zoom>/<true-lat>,<true-lon>/<osm-username>

* 
/modify/<layer-name>/<layer-lat>,<layer-lon>/<new-layer-lat>,<new-layer-lon>/<version>/<min_zoom>/<max_zoom>/<true-lat>,<true-lon>/<osm-username>

* /delete/<layer-name>/<layer-lat>,<layer-lon>/<version>/<osm-username>

* /get/<layer-name>/<SW-lat>,<SW-lon>/<NE-lat>,<NE-lon>/<current-zoom>

_______________________________________________
josm-dev mailing list
josm-dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/josm-dev

Reply via email to