Re: [Potlatch-dev] P2, snapshot-server, imports, vector layers and more

2012-11-15 Thread Andy Allan
On 15 November 2012 08:37, Richard Fairhurst wrote:

 For 1; we could continue with vectors.xml, and also provide a way to provide
 a URL in the embedding page/query string (much as you can with background

Recently I've been looking at the tilejson spec, which the Mapbox guys
developed for map layers. It's a way of describing what tiles are
available, the extent of the map, the attribution and so on in a json

I think we could make imagery.xml more lightweight if we encourage
sources (e.g. our ooc maps) to provide a tilejson document - then our
imagery list can be just a list of URLs to the tilejson documents. It
will also then simplify the experience for a user adding their own
imagery, since all the extents, zoom levels etc are figured out

I'm therefore also wondering if we can come up with a similar json doc
for vector background layers, that applications (p2/josm) can use to
figure out all the information they need. At the moment
snapshot-server displays the xml for you to copy and paste into
vectors.xml, but Paul has highlighted the need for users to add their
own snapshot layers to whichever instance of p2 they are running.
Pasting a json-endpoint URL is perhaps much simpler than building a
dialog to paste in xml snippets.


 (It might be possible to do what JOSM does by putting the sources on a wiki
 page, rather than relying on a commit to the P2 repository, but I'm always a
 bit wary of people adding Google imagery etc. without us noticing. Any

Eugh, no. Let's stick to keeping things specified in the repository -
with github's web-based file editing, it's as easy to contribute to as
a wiki, but with enforced review during the pull requests.

 For 2; we could add a new menu like the 'Background' one showing data layers
 in the current area.

I'd like to see something like this.


Potlatch-dev mailing list

Re: [Potlatch-dev] Flash Player minimum version

2012-03-21 Thread Andy Allan
On 21 March 2012 16:00, Tom Hughes wrote:

 By earlier on do you mean earlier today?

 Only we started requiring 10.2 about 9am today and that was only reverted
 back to 10.1 just before 11am when Richard's fixed version of Potlatch was

Yeah, I just read the commits. We were having trouble About 5 hours
ago according to, which is, roughly, 11am.
I've therefore no idea whether we were testing the current or previous
build of p2!

Bad timing really.


Potlatch-dev mailing list

Re: [Potlatch-dev] [OSM-talk] Way with only one single node

2012-03-21 Thread Andy Allan
On 21 March 2012 12:56, Steve Bennett wrote:

 1) We can fix this, but it's hard to prevent it coming back when new
 features are built. I've probably written such bugs.

Mumble grumble unit testing.

 3) I still think we should do this. We have a responsibility to not
 mess up the database. Saying well, we should avoid writing bugs
 isn't addressing that: we should both implement this failsafe
 mechanism, *and* avoid writing such bugs.

Well, I'm not sure I agree on this one. If it was a truly awful thing
to do, the API would prevent it. Given that it's not truly awful, it's
not something to worry about too much. It's not messing up referential
integrity, it's just something unexpected and, at the moment,
seemingly useless.

Furthermore, handling it at save time is, to me, the wrong thing to
do. What do we do when we find our data has an issue? Alert the user?
Silently swallow it? Neither is a good thing. Should that way be
deleted? Should a node be re-inserted? What did the mapper mean to
happen? We can't tell.

Finally, in other projects I follow the convention of don't code
defensively, as described at and elsewhere.
The save code should trust that the data is good. If the data isn't
good, whatever made it bad should be fixed. Otherwise it's turtles all
the way down - should the save code check the ids are actually
numerical, just in case, should it do x, y or z, just in case? So the
answer is that the input should be checked, somewhere in the
controller code, and then it should be trusted.

Anyway, mumble grumble unit testing. When we find out what's the
trigger, for the love of god someone should help me write the unit
test so that when it's fixed, it stays fixed.


Potlatch-dev mailing list

Re: [Potlatch-dev] [OSM-talk] Way with only one single node

2012-03-21 Thread Andy Allan
On 21 March 2012 16:34, Richard Fairhurst wrote:

 I've corresponded with Thomas B and found some, ahem, fairly easy steps to

 1. Click on map (_once_) to start new way
 2. With elastic band still engaged, click 'Save'
 3. Whatever the opposite of PROFIT is

 Will look at it this weekend I guess.

My initial thought would be to not create the way until the second
node was drawn. I think that would also remove a lot of the gnarlyness
around POI creation, where we are footling with the
way-that-we-never-actually-wanted as we finish handling the double

Also, if anyone smarter than I am (Dave?) wants to point me in the
right direction, I'd love to bind the controller state and the data
state together a bit better, so that when you're doing things like
undo you not only change the data, but put the controller into the
appropriate state at the same time. That's only tangentially related
to the above problem, however.


Potlatch-dev mailing list

Re: [Potlatch-dev] Testing new versions

2012-03-08 Thread Andy Allan
On 7 March 2012 20:12, SomeoneElse wrote:
 This may be a silly question - asking for something that exists already, but
 just in case not:

 How hard would it be have a version of Potlatch2 available after merging for
 final testing before becoming the default P2 version on the site?  To be
 useful it'd need to be able to be invoked with a GPX file (not necessarily
 as another edit dropdown, though that'd be nice).  With the best will in
 the world, sometimes when fixing stuff other stuff breaks, and it'd be nice
 to be able to catch any issues before they go live for everyone.

There's two approaches here.

First, for the when fixing stuff other stuff breaks - the correct
solution there is automated tests. We use them extensively on other
projects, such as the rails port. For most of the projects I work on I
have a simple rule of thumb - writing exhaustive tests is exhausting,
but any time there's a real-world breakage, write a test for that.
Breakages are inevitable, but breaking the same thing twice is

But there's plenty of worthwhile acceptance testing beyond just
automated tests. The issue at the moment is that we run a very tight
loop between Richard committing to potlatch2 master and it being
deployed on For final testing to work we would need to
deliberately add a delay, and we need to work out whether the delay is
fundamentally worthwhile.

If it is, then one easy way to control the delay is using numbered
releases. We could commit to master (which means it appears on e.g. ), and then give it a
day or so before tagging that with a release number. then
would only deploy versions with an explicit release tagged.

But at the moment, I'm not sure whether it's worth adding in the
artificial delay between fixing a problem and deploying the new
version. I suspect it's more worthwhile to work on the automated
tests, so that when we fix something, we're confident that we haven't
broken anything else.


Potlatch-dev mailing list

Re: [Potlatch-dev] State of play

2012-03-05 Thread Andy Allan
On 5 March 2012 04:01, Steve Bennett wrote:

 undo on creating way fix,

 Definitely worthy of review - it's totally possible that I broke
 something else. Anyone else want to have a look at it? I guess we
 don't have any tests?

We don't have any tests that cover starting drawing a new way.

I'd absolutely love to have tests that cover all the Actions though -
it's so important not to mess up the data in some subtle way while
refactoring. After that, we can test whether pressing the buttons
has the desired effects.

There are some very basic Action tests at
already, but to say they are very basic is slightly overselling
them! We're also lacking tests on most of the Entity functionality


Potlatch-dev mailing list

[Potlatch-dev] Flex 4.6 - should we upgrade?

2012-02-21 Thread Andy Allan
Hi all,

Flex 4.6 was released in November. Do we want to upgrade (from 4.5)?

I'm not sure if there's anything in particular that we're after in
4.6, but some of the new controls look nice. Most of the work seems to
be targeting mobile apps.

The biggest drawback would be having to bump the minimum target player
to 11.1 , from 10.2. Anyone got any opinions on that?


Potlatch-dev mailing list

Re: [Potlatch-dev] Designation tag on most map features

2012-02-20 Thread Andy Allan
On 19 February 2012 07:16, Steve Bennett wrote:

 Obviously 2) is easy to fix. But what about 1? Is it time we
 implemented locale-specific map_features?

I refer to them as region-specific map_features, not locale-specific
map features - locale and language are too easily confused!

This has been a long-term goal of mine, stretching back many years. I
want to tailor things like road signs (and hints on what format the
references should be) on a per-country basis - so that when you're
mapping in Switzerland there are green Autoroute signs and when you're
in France it knows that highway=secondary is a Departmental road with
refs starting with a D.

However, to say that adds complexity would be an understatement. I'm
not going to start on that until we have a much better idea how to
manage it - we aren't even at the stage of widespread UI translations
yet, and we don't have a translatable global map_features yet, so I'm
not going to start making life even more complex by adding in regions!

The end goal, for me, is definitely a cross matrix of language and
regions, so that no matter what language you speak, and what country
you happen to be in today, the interface looks as much like what you
have in the photo as possible.


shows the tip of the iceberg

Potlatch-dev mailing list

Re: [Potlatch-dev] Github, and tram/road issues

2012-02-16 Thread Andy Allan
 On 16 February 2012 06:03, Steve Bennett wrote:
 Hi all,
  I just did a pull request to the Github repository (which is fairly

You just made a pull request to a read-only mirror.

 up to date) but it looks like no one is watching. Is there somewhere
 else these pull requests should go? It's here anyway:

We like patches in any way, but if you're sending a pull request,
please send it to systemed on github ([1]) aka Richard, rather than or the openstreetmap  account on github.


Potlatch-dev mailing list

Re: [Potlatch-dev] Potlatch doesn't work after recompile

2012-01-03 Thread Andy Allan
On 30 December 2011 20:09, Eric Wolf wrote:
 I had to stick this in my blog because the listserv choked on the original
 email - I was being too detailed.

 In a nutshell, if I make a trivial code change and recompile Potlatch with
 ant, the resulting code doesn't work. The problem is explained in detail

Hi Eric,

I tried investigating this last week, but since it takes sooo long to
compile potlatch on my laptop I had to give up! I spent an hour or so
compiling over and over this evening instead.

First off, don't worry about ant test not working. The unit tests
have been broken for a few months since various internal APIs were
changed without also updating the tests[1].

Secondly, I see the same problem as you're seeing with the builds
running successfully but resulting in unusable .swf files. The error
messages are slightly perplexing so I've no idea what's the cause.
I'll note simply that I can make debug builds using the fcsh command
line compiler, and also using ant release to build non-debug builds
that work fine too.

If anyone has any clues as to what's up with the build system, please shout!


[1] It's a shame the unit tests are so unloved - I find these prove
remarkably useful in so many other projects.

Potlatch-dev mailing list

Re: [Potlatch-dev] Internationalisation

2011-11-30 Thread Andy Allan
On 28 November 2011 22:59, Richard Fairhurst wrote:
 So... hopefully you won't be getting [Object object] any more. If you do:
 speak out!

Any feedback from anyone? I'd love to hear from people who

a) i18n was working 2 months ago and is working now
b) i18n was working 2 months ago and isn't working now
c) i18n was not working 2 months ago but is working now
d) i18n was not working 2 months ago and still isn't working now

The biggest problem is that I'm in group a) so it's hard for me to
debug. b) would worry me, c) is ideal and d) would be unfortunate but
certainly worth knowing.


Potlatch-dev mailing list

Re: [Potlatch-dev] Potlatch 2.3

2011-11-30 Thread Andy Allan
On 26 November 2011 12:32, NopMap wrote:

 I played at migrating to P2.3 again and ran into a few problems.

Hi Nop,

First off, two apologies. P2.3 was released with a major upgrade to
the flex libraries that pretty much broke i18n completely, although
due to the seemingly never-ending saga of me being unable to reproduce
problems meant that it wasn't explained clearly in the release

Second apology is in not getting back to you at the weekend, since I
knew I was going to be doing a lot of work around i18n and hoping to
fix things. See the other thread for more on this.

Now, to your points:

 Is there a full set or browsable instance of the locales somewhere?

See which is a
continually updated build of potlatch2 with directory browsing
enabled. I've also added a trac ticket to provide bundled builds in
order to cut down on these hassles.

 2. setting the locale. How do you do that in P2.3? The parameter format has
 changed, it used to be fo.addVariable(locale, de_DE); but what is it

Try again with 2.3-112 or later, it should be working, thanks to work
by Hiroshi.

 3. Config files. There was a hint earlier in this thread that the config
 file format has slightly changed. At first glance, my unchanged files appear
 to work. Can you give me more information where adjustments are necessary?

I'm not sure which config files you are referring to, but perhaps
Richard can describe more the subcategory panels work.

 4. Authorization. P2.3 asked for a fresh authorization key. What changes
 cause it to do that? That request seems to pop up from time to time, I found
 that I had about 10 authrizations in my osm account. The question is also
 asked occasionally by users.

That will happen when either the flash cookies are cleared, or the
.swf is served from a different URL. Perhaps your users have browser
privacy plugins that are clearing saved flash cookies?

 When i executed the authorization, I had firebug running as I used it to spy
 on P2. This caused Firefox to always crash after the authorization window
 opened. After disabling firebug it worked. Is this a known problem?

Haven't heard of that before.


Potlatch-dev mailing list

Re: [Potlatch-dev] Alternate look and feel

2011-11-28 Thread Andy Allan
On 26 November 2011 23:48, Richard Fairhurst wrote:

 I'd like to offer two bundled stylesheets for the app: one that works with
 the site design, and another, more generic one suitable for
 third-party deployments. (You'll also be able to supply your own stylesheet
 if you compile just the one stylesheet file with Flex SDK.)

That's a good spur for me to continue porting the visual components
over to their spark equivalents - not only is it good for consistency,
but it'll make the stylesheets easier! There's plenty of easy upgrades
that can be made, but I'm surprised to find there's still a few
components that don't have spark equivalents yet. I guess the key is
to upgrade all the ones we can.


Potlatch-dev mailing list

Re: [Potlatch-dev] [Talk-us] Address improvement through imports?

2011-11-09 Thread Andy Allan
On 5 November 2011 18:11, Michal Migurski wrote:

 You probably don't even need to fork it. I suspect you could get most of the
 way there with a custom P2 style, a custom map_features.xml, and Andy's
 awesome new snapshot stuff (which is expressly designed for manually
 bringing in data from other sources). potlatch-dev is happy to help. :)

 Hi, this sounds cool! I don't closely follow potlatch-dev but I'm curious 
 about this feature.

Hi Mike,

It's a prototype feature, and poorly documented! The basic scenario is
that you have a .osm file representing some kind of external
datasource, that you want to combine into OSM - i.e. not blindly
upload directly to the main server. So you load the data up into a
small rails app (snapshotserver)[1] which serves it out as map
requests, and you use potlatch 2 to allow people to go through each
feature and reconcile them with what's already in OSM. As a bonus, you
can mark features as complete, thereby collaboratively reviewing the
external datasource.

There's some information about this on the wiki[2] and a blog by
Cyclestreets, who commissioned the work[3]

I'd love any feedback you have on it.



Potlatch-dev mailing list

Re: [Potlatch-dev] Potlatch 2.3

2011-10-21 Thread Andy Allan
On Thu, Oct 20, 2011 at 11:07 PM, NopMap wrote:

 Unfortunately, this did not work. There is no counterpart of activity viewer
 for firefox.

Firebug's Net console gives you the equivalent, if I understand
Richard correctly.

 Trying to execute the above line with git produced the error message:
 Cloning into c:/Data/Maps/potlatch...
 Permission denied (publickey).
 fatal: The remote end hung up unexpectedly

Richard gave you his private link to github (since he was logged in at
the time) so that's why you didn't have permission. The public
equivalents are or

You can also grab it from the osmf git mirror, which reflects the
deployed version, at

I've also updated the Developer Documentation to include the upgrade
to flex 4.5.1

Finally, if you want the contents of the source code directory without
messing around with git, then there's a Zip download button on the
github pages which will simply give you a tarball to download.

If there's anything else, give me a shout.


Potlatch-dev mailing list

Re: [Potlatch-dev] Potlatch 2.3

2011-09-30 Thread Andy Allan
On Fri, Sep 30, 2011 at 6:29 PM, Richard Fairhurst wrote:

 Thanks to Andy for huge amounts of work on this.

You're welcome - it's great to see it all finally coming together!
Preparations for this release started way back in May with the fp10

There's a lot of work to be done to take advantage of various new
things - Flash Player 10 means that we can use Vectors instead of
Arrays in order to improve type safety and opens the door to local
filesystem access - think loading gpx traces - but the main thing I'm
looking forward to is using the new features of Flex 4.5 user
interface components. At the moment we have a bit of a mixed bag of
components between the old mx ones and some of the new spark ones, but
when the migration is completed we'll have great possibilities. It's
also a significant help to any other flex developers or designers who
want to jump in and help us out!

I'm hoping that some of our developers can help get to the bottom of
all of our translation issues - it's been a real bugbear for some time
now and I'd like to get it well and truly fixed.


Potlatch-dev mailing list

Re: [Potlatch-dev] [Talk-GB] 'Can't load map'

2011-09-29 Thread Andy Allan
 So now if you get a simple Couldn't load the map it means a 500 server
 error genuinely came back from the API. This is the sort of thing that
 basically shouldn't happen, but it can occur, AIUI, if the daemon restarts
 halfway through the response; I've had that very occasionally.

Taking this to potlatch-dev

I'm really, really hoping that this has fixed everything. However, I
still have a lingering suspicion that there's a client-side issue
where the URL is never actually requested. I've seen this happen with
the linux debug player against a local rails install using wireshark,
and I suspect it happens on the release flash plugin too against the
main server, but I haven't captured with wireshark conclusively. And
so I can't pin it down and it takes friggin ages to try and trigger

I've found it happening when panning around lots, and I wonder if
there's a max-concurrent-requests issue somewhere between flash and
the browser. I've seen enough reports about this, and experienced it
often enough myself,  to believe that it's not actually the site
that's returning that many errors.

Maybe we'll need to trap map call errors in potlatch and ping a
logging url to let us reconcile times-potlatch-thinks-it-got-an-error
with times-the-rails-serves-logged-sending-an-error and see how they


Potlatch-dev mailing list

Re: [Potlatch-dev] Git starter?

2011-08-31 Thread Andy Allan
On Wed, Aug 31, 2011 at 4:13 PM, Steve Bennett wrote:

Yes, but this was causing lots of issues, as I'm sure you remember.

 Actually not - apart from my commiting changes in insufficient
 granularity. Happy to take your word for it, though.

A few other things spring instantly to mind - an ill-advised redesign
of the Undo system, a few problems with the Magic Roundabout system
(e.g. having a 50% chance of nuking a way when trying to shorten it)
and, more than anything else, lots of cases of commits generating
compiler warnings. That these commits were to trunk kept necessitating
other developers stepping up and fixing the build before they could
continue with their own work. That was getting quite disruptive.

 You're probably aware of the long-running debates about pre-commit
 review versus post-commit review. Quick summary: pre-commit review
 reduces developer activity level but improves quality.

I don't know much about the different approaches from a theoretical
viewpoint, except that the way were were doing it before caused us
lots of issues, and was making refactoring nigh on impossible.

As Richard has said, his master branch is the canonical 'this is
Potlatch2', so he's in charge

 Cool. This is the definitive statement lacking from the wiki page,
 which confused me.

I'd written that before the situation was clear. But there's also the
distinction that it's not necessarily what OSMF is deploying, and I
try to discourage anyone from getting worried about which repo to
clone from. If you clone from mine, and then want to pull changes from
someone else, it all comes out the same. Any notion of One True Repo
just causes more confusion later on!

 1) There is still a definitive repository

Make sure you realise that there's nothing that makes it the
definitive repository other than social factors. Unlike svn there's no
central repository. It's only definitive in that Richard is the
current maintainer, and the only difference he has over the rest of us
is that TomH generally doesn't disagree with him (on p2 matters at
least!). But you could also view the OSMF repo as definitive if you
care about the version that's actually deployed on

There are circumstances (we've done it two or three times already that
I can recall) where TomH pulls in bugfixes from my repo straight into
the OSMF one and deploys that, when RichardF wasn't around to update
his own repository. That's fine, git is totally decentralised like
that so it works.


Potlatch-dev mailing list

Re: [Potlatch-dev] Upgrade to fp10 + flex4

2011-06-30 Thread Andy Allan
On Thu, Jun 30, 2011 at 7:06 AM, Frederik Ramm wrote:

 On 06/30/11 01:39, Greg Troxel wrote:

 Does this work with gnash?  I have gnash 0.8.9 installed, and I've been
 able to use potlatch1 but not potlatch2.

 As far as I understand, your ability to use gnash is unaffected by this
 change, i.e. you will still be able to use Potlatch 1, and you will still
 not be able to use Potlatch 2.

That's correct. gnash only supports old flash applications written in
ActionScript 2 (e.g. potlatch1). They don't seem to have made much
progress at supporting AS3, since it needs a whole new AVM (AVM2) to

Greg, you want to look at the lightspark project, . It's direct goal is AS3
support, it's under heavy development and is much more likely to
support potlatch2 than gnash ever will. They've implemented a fair
amount of the AS3 language but it's not yet enough to run potlatch2.
We have a tracking bug for this with them at . I'd be interested
to see if anyone has any insights as to how close they are to
supporting enough language features for p2 to run, and doubly
interested in anyone who wants to help them with their coding to
achieve that goal.


Potlatch-dev mailing list

Re: [Potlatch-dev] [OpenStreetMap] #3855: PL2: remember custom imagery between sessions

2011-06-22 Thread Andy Allan
On Wed, Jun 22, 2011 at 3:23 PM, OpenStreetMap wrote:
 #3855: PL2: remember custom imagery between sessions
  Reporter:  sdoerr       |       Owner:  potlatch-dev@…
     Type:  enhancement  |      Status:  new
  Priority:  minor        |   Milestone:
 Component:  potlatch2    |     Version:  2.0
  Keywords:               |
  Modify Potlatch 2 to remember custom imagery settings from one session to
  the next.

And every time this feature gets used, it should ask why the
background layer hasn't simply been added to the config file instead!

Seriously, I don't think we're doing enough to encourage people to add
background layers to the standard configuration files. I'd have
expected about 100 different rasters by now in imagery.xml


Potlatch-dev mailing list

Re: [Potlatch-dev] Translation?

2011-06-08 Thread Andy Allan
On Tue, Jun 7, 2011 at 8:49 PM, Jeff Haack wrote:
 How to do a translation of Potlatch 2?

Thanks for your interest - you should have a read of the following
message to see the current state of the translation work.


Potlatch-dev mailing list

Re: [Potlatch-dev] [OpenStreetMap] #3671: Tag auto-completion is a bit random

2011-05-27 Thread Andy Allan
On Fri, May 27, 2011 at 11:27 AM, Richard Fairhurst wrote:

 a) Andy pushes the patch to his repository on github
 b) I pull it into mine and review it (which takes 0.0005ms to check that
 it's a good patch, and about 30 minutes to remember how to do this in git)
 c) I push it to my potlatch2 repository on github (the Potlatch 2 master)
 and alert Tom
 d) Tom checks I haven't done anything evil and deploys it on

Arguably I'm slightly out-of-line marking trac reports as
closed-fixed before they are pulled by Richard and (arguably) they
should still be open until they hit the deployed version on
But it makes my life easier to mark them as fixed when the fix has
been written (and when I'm pretty sure that that fix will be
accepted), and in our trac fixed automatically marks the issue as

Perhaps I should just tag a warning onto my trac comments that while
it's fixed it needs to wait on the next release before it'll become
live to save any confusion.


Potlatch-dev mailing list

Re: [Potlatch-dev] [Talk-GB] OS 1:25k Layer in Potlatch 2

2011-04-12 Thread Andy Allan
On Tue, Apr 12, 2011 at 2:32 PM, Ed Loach wrote:
 Steve wrote:

 Is this working? I just noticed that, for Meopham in Kent, I can
 the 1:25k OS map as a background in Potlatch 1, but nothing
 Potlatch 2.

 It looks like Potlatch 1 is loading .jpg and Potlatch 2 is failing
 to load .png, if that helps.

Gah, another one! We fixed the 7th series at the Hack weekend, but it
looks like we didn't notice this.

I've just created the patch to fix this, and if anyone notices any
more mistakes (or omissions) in
then let us know, either by trac tickets or on the potlatch-dev list.


Potlatch-dev mailing list

Re: [Potlatch-dev] [OpenStreetMap] #3587: Tag keys/values should be restricted to 255 characters

2011-03-22 Thread Andy Allan
On Thu, Mar 17, 2011 at 4:30 PM, OpenStreetMap wrote:

  Unfortunately, these critical errors seem to be a result of multiple


  * 5. If the ADVANCED tab remains EMPTY or keeps the properties of the
  PREVIOUS edit though you have added a pylon (with R), you have reached the
  stage two steps BEFORE the crash happened (!!).

Well, I don't have steps to reproduce, but I encountered this during a
recent changeset. No matter what I clicked on, the Advanced panel
showed the same tags - but the way ID at the top changed when
selecting different things.

The first problem I noticed was in trying to delete TIGER tags -
deleting from the bottom upwards by pressing X the tiger uuid tag
disappeared, but then the tiger tlid one didn't. After that it got

Interestingly, when I tried reproducing it I couldn't find any roads
where deleting the tlid caused an issue, but I've just realised my p2
instance is again stuck, this time with more TIGER tags deleted. I can
now confirm the Simple panel works properly when the Advanced panel is
stuck in this manner. In neither case was I merging ways, in the
second occurrence I was only selecting ways and pressing X to delete
tags - no other actions.

I'll post when I have steps to reproduce / run it in a debugger / a patch :-)


Potlatch-dev mailing list

Re: [Potlatch-dev] HOT Potlatch2 presets

2011-03-15 Thread Andy Allan
On Tue, Mar 15, 2011 at 2:53 AM, Pierre (PierZen) wrote:

 When selecting a node or a way, and selecting a HOT Menu item on the left,
 the dialog box and name of the category listed always correspond to IDP

There aren't any tag elements defined in your files, so nothing will
work properly. You need to specify the key/value for each object, so
that it can be added when you drag+drop, and also so that it's

All your icons have no tags defined, so when it's added to the map
it's recognised as the first feature without any tags defined (i.e.
IDP camp).

(Perhaps we should change the behaviour of P2 to simply ignore any
feature that has no tags defined.)

Also I'm rather uneasy about the definitions that I see in there, such
as multiple uses of key Surface (with capital) with values like
Gravel, again with capital letters, as well as multiple sections
where the value and text are the same (and don't look to me like
normal OSM values). If you're still testing things out, please don't
use a copy of Potlatch2 accessing the live server until you have
things working properly. Use the development server at instead.


Potlatch-dev mailing list

Re: [Potlatch-dev] Ooops

2011-03-11 Thread Andy Allan
On Fri, Mar 11, 2011 at 8:44 AM, Ed Loach wrote:
 I created this way yesterday by mistake:
 Is this a known issue, or should I report it in trac?

It should be reported to trac, but it's best if you get some steps to reproduce.

But I've just spend two secs investigating, and it's quite easy to reproduce.
* Start drawing from an existing node.
* Pause for a second
* Click the same node again.

Voila, the way ends as is the same node twice, e.g.

I'll make some investigations. It doesn't happen if you're just
starting a new way.


Potlatch-dev mailing list

Re: [Potlatch-dev] MapCSS clarificiation

2011-03-11 Thread Andy Allan
On Fri, Mar 11, 2011 at 12:41 PM, Serge Wroclawski wrote:
 I have a question about MapCSS.

 This may end up being moot, because the implementation may drive the

There's multiple implementations, and some of them are much more
advanced than Halcyon is.

 way[highway=primary]  color: red; ...

 way[name=Main Street] ... color: blue; ...

 Which rule would apply to the street?


 More importantly (since that queation can be tested), which is the right 

Rules are parsed in order and applied in order - it's the way that CSS
works too. Later rules can override ones set earlier.


Potlatch-dev mailing list

Re: [Potlatch-dev] Ooops

2011-03-11 Thread Andy Allan
On Fri, Mar 11, 2011 at 9:01 AM, Andy Allan wrote:
 On Fri, Mar 11, 2011 at 8:44 AM, Ed Loach wrote:
 I created this way yesterday by mistake:
 Is this a known issue, or should I report it in trac?

 It should be reported to trac, but it's best if you get some steps to 

 But I've just spend two secs investigating, and it's quite easy to reproduce.
 * Start drawing from an existing node.
 * Pause for a second
 * Click the same node again.

 Voila, the way ends as is the same node twice, e.g.

 I'll make some investigations. It doesn't happen if you're just
 starting a new way.

OK, I've fixed this and I'm pretty sure it works[1]. However, the logic is getting ever-more complex and I think the nested
if-then-else loops can probably be refactored to make things clearer.
I'm loathe to refactor them until we get some unit tests since there's
a surprisingly large number of things you can do when drawing!


[1] It'll need deploying at some point when the sysadmins get a chance.

Potlatch-dev mailing list

Re: [Potlatch-dev] Bug: Selection broken after save

2011-03-09 Thread Andy Allan
On Tue, Mar 8, 2011 at 8:09 PM, NopMap wrote:

 I think I know what's happening.

 To reproduce the error: Enter a checkin comment with an uneven number of
 spaces in the text.

 P2 reacts to the spaces as if no dialog was open and goes into background
 offset mode. With another press of space you can unlock the map.

 P2 needs to be aware that a dialog is currently open and ignore all shortcut
 keys when they occur in the text.

 Can you please confirm my theory?

There were actually two problems along very similar lines - your one,
and another one introduced recently and only spotted this morning.
Both have now been fixed in commit b2c4b2 and deployed to

Thanks for figuring out how to reproduce it, it made this much easier
to figure out.


Potlatch-dev mailing list

Re: [Potlatch-dev] Codebase and git

2011-03-08 Thread Andy Allan
On Tue, Mar 8, 2011 at 8:12 PM, Serge Wroclawski wrote:

 For potatch2, especially, I foresee developers customising it for
 various use cases (like I'm doing), and git is very useful here
 because it allows someone to customize their instance while keeping up
 to date with the core.

This is what's been happening with the MapQuest version of potlatch2
for the last few months - I was using git-svn for the core work, and
then maintaining the MQ version in a branch and publishing that branch
to a separate git repository. Now I need to do some work to rebase all
the changes onto the new repo, since TomH's version has better commit
attribution and all the SHA1s have changed!

I see all this as helping us move to having multiple versions of
potlatch2, where the one deployed on is just one of many of
varying levels of customisation.


Potlatch-dev mailing list

Re: [Potlatch-dev] What to code next?

2011-03-03 Thread Andy Allan
On Thu, Mar 3, 2011 at 1:07 PM, Richard Fairhurst wrote:
 Steve Bennett wrote:

  Just wondering if anyone has any cool ideas for features or whatnot,
 that they haven't got around to entering as bugs in Trac.

 Like I said the other day, stability is definitely the watchword right now,
 so we can get P2 ready to become the default editor. No new features until

One piece of very low-hanging fruit is to get all the dnd icons to
show the same (but smaller) icon when dropped onto a map styled with
the default potlatch.css. The inconstancies are annoying. There may be
some cases when the positive version of the icon is better on the map
than the negative one, that'll need some judgement.

Another much harder thing is gracefully handling both drag and drop
and attempting to draw before the map has loaded - at the moment dnd
throws an exception, and the icons just disappear - with drawing you
get the elastic but nothing else.

Thirdly I still find the shift key stopping working every now and
then, but like Richard I don't have steps to reproduce this one.


Potlatch-dev mailing list

Re: [Potlatch-dev] Introducing Magic Roundabout tool

2011-02-25 Thread Andy Allan
On Thu, Feb 24, 2011 at 10:47 PM, Steve Bennett wrote:

 Whoops, sorry about that. All fixed now.


 I've discovered some slight flakiness, in that occasionally it
 produces a bad result, and if you try to undo, you get an exception.
 I'll need to understand a bit more how to use the undo system.

Regarding the Undo system - while we all hail randomjunk as the only
one who Truly Understands how it works, I've been toiling away as an
apprentice for a while now[1] and pretty much have got to grips with
it. I've taken a few hours this morning to put together a wiki page
with some documentation, that as it says at the top, may or may not

I'd suggest reading that - if by magic it's comprehensible, the next
bit of this email might make more sense.

As for your code, the two^Wthree^Wfour things I can spot straight away are:

1) In you're adding two different things
to the undo stack - the first and last lines are adding a composite
action called undo that doesn't actually do anything. The middle
line asks MagicRoundabout to return its resulting action to the
MainUndoStack. So two ways of achieving similar goals would be:

new MagicRoundabout(currentNode(), elastic.length,


var undo:CompositeUndoableAction = new CompositeUndoableAction(Magic
new MagicRoundabout(currentNode(), elastic.length, undo.push);

... but since the second one would be creating a composite action, and
pushing only one action onto its list, it's a bit redundant.

2) calls performAction multiple times - instead
you could create a compositeaction, add the new way and all the
splitways to it, and send it back in one go.

3) Assuming you do 2), then when magicroundabout finishes adding
SplitWayActions it'll need to add a MakeJunctions action, to the list
too. But MakeJunctions accesses the undostack directly (line 40) so it
breaks the undo chain. MakeJunction should be rewritten to take a
performAction function and instead of doing things itself, pass the
actions back to the caller.

4) MakeJunction calls MainUndoStack...addAction() in a loop - that'll
add a separate undo step for every junction. Since only one keypress
causes MakeJunction, it should be undoable in one button press.
MakeJunction should have its own composite action and push things onto
it when it loops round like this, then passes just one action back to
the caller.

Oh, and finally, I suspect some of these composite actions should be
in net/systemeD/connection/actions - especially MakeJunction since
you've now shown with MagicRoundabout that it's a useful too for other
actions to build on top of.

Right, well, if this all turns out to be gobbldy-gook don't worry too
much - I'm happy to rewrite them when I get a chance. If you want to
give it a go yourself I'm 100% happy to explain further or answer


[1] Like, years, man

Potlatch-dev mailing list

Re: [Potlatch-dev] Introducing Magic Roundabout tool

2011-02-25 Thread Andy Allan
On Fri, Feb 25, 2011 at 1:17 PM, Steve Bennett wrote:

 Does this absolutely have to be the case? I can't quite understand,
 from a theoretical point of view, why this principle is necessary. Why
 not add the action to a stack, and also carry it out now? What's the
 benefit of maintaining the current state as long as possible, then
 doing all the actions in one flurry?

This is where I could be wrong, but I think that it's critical to the
redo part. When undo'ing an action the action is added to the redo
list, so if adding an action has side-effects that'll blow up during
redoing the action. Also, if the action works based on side effects
that aren't tracked within the action itself, then it won't work
properly when being redone. Hence everything needs to be done by
adding things to an action, and it needs to be completely
self-contained so it can be moved back and forward between the
different stacks.

But I might be wrong.

 And just to add a bit more incoherent rambling, would a simpler model
 be, instead of passing around these stacks everywhere, to have just a
 main undo stack with two functions:
 1) RecordAction which adds an action to the undo stack, and carries it out.
 2) FinishUndoBlock, which groups all actions since the last time it
 was called, into one block, which will all be undone with a single
 keystroke. Sort of the equivalent of closing a changeset.

That's just an unclear representation of a composite action! The
RecordAction is undo.push, the FinishUndoBlock is
MainUndoStackaddAction(), and the
carrying-out-before-we're-finished is the bad idea that we need to

 But, since I clearly don't understand how this stuff works, these
 impertinent suggestions may be completely off the mark.

Since I barely understand how it all works, but it certainly does
work, I tend to just try to figure it out! When (if) I ever get to the
point where I fully understand it then I might change my mind, but I'm
not there yet.


Potlatch-dev mailing list

Re: [Potlatch-dev] Introducing Magic Roundabout tool

2011-02-25 Thread Andy Allan
On Fri, Feb 25, 2011 at 1:17 PM, Steve Bennett wrote:
 actually needed the split to have taken place so I could identify
 which half of the split was the one that I wanted to delete.

Without fully understanding things - do you? Instead of splitting the
way and deleting one half[1] are you not instead figuring out which
nodes to delete from the way? Given that you know before you start
which end of the ways you'll delete from, then it's probably
possible[2] to do it that way.


[1] My split-way-and-get-relations-right code is sobbing at the
injustice of it all
[2] This is not a money-back guarantee offer

Potlatch-dev mailing list

[Potlatch-dev] i18n using babelFx

2011-02-18 Thread Andy Allan
Following on from a discussion last year[1] I've started work on
internationalisation of p2 using the babelFx[2] i18n framework. This
lets use keep the internationalisation separate from the rest of the
development, rather than covering the code in standard flex
resourceManager calls. It's the same framework as was discussed back
in August.

There's a few, err, issues with what's been done so far, so here goes:

1) There's a bug where the default locale, en_US, isn't loaded at
runtime. It's apparently been fixed[3] but I still couldn't get it to
work. If anyone else knows more about compiler parameters, resource
bundles and/or locales in flex then please enlighten me!
2) It doesn't appear to fall back to the hardcoded strings when the
resource bundles key/values are missing. I don't know whether that's
by design but it makes everything a bit fragile.
3) There's no automated locale switching yet. Play with recompiling
for now with different locales. The only reason there's a hardcoded
switch-to-en_GB is due to point 1)
4) I've seen flickering as text is injected and components resized,
and you can spot blank labels as components are drawn before the
locale has been loaded.
5) The locales have been set up as runtime-loaded resources, since
that's apparently how it should be done rather than bundling them
all into the .swf. I suspect bundling would help 4 but in the long run
it could turn really nasty with 40+ locales bloating the .swf
6) The logging is currently insane, but that's easily switched off.

You need to, at a minimum, ant deployLocales to get the locale .swfs
into resources/ otherwise things break. You'll notice something is
wrong because there will be no text on the undo/redo buttons. If you
are using ant to compile the whole thing it should work.

I would say if anyone wants to translate the whole app, hang fire
until we've got some of the bugs listed above worked out.




Potlatch-dev mailing list

Re: [Potlatch-dev] Suggestion for lifecycle tag - comments?

2011-02-16 Thread Andy Allan
On Wed, Feb 16, 2011 at 2:16 AM, Steve Bennett wrote:
 On Wed, Feb 16, 2011 at 9:41 AM, Andy Allan wrote:
 My first thought is to just have another couple of highway types ( a
 proposed highway and a highway under construction ) with a list of
 classifications in a choice input, and maybe some date inputs for when
 they are opening and so on.

 My feeling is that proposed is really not a type of highway, and
 that eventually this tagging scheme will be replaced by something a
 little less idiosyncratic:


No, it won't, for reasons already explained by Nop. Moreover the
current system has the distinct advantage that it can be used to
describe what's on the ground - a stroke of a pen on a planner's chart
isn't a slight variant of a secondary road, it's something else
entirely ( a proposal ) and hence is a separate high-level concept.
Similarly, if you stumble across a strip of gravel surrounded by men
with shovels you can be pretty sure it's a road under construction,
but you would need further investigation to tell what kind of road it
might at some point become in the future.

I think the tagging scheme isn't idiosyncratic but is actually well
thought through, but even without giving a fig about tagging I don't
want to see proposed/construction/actually-exists as a property on all
the roads within p2.

 Ok, first, I don't think the UI would be different either way. All the
 code would be happening behind the scenes, to make a simple UI: simply
 an extra dropdown on a misc tab or something.

Which is actually a different thing. What I'm suggesting is that
proposed and construction would be two more icons on the grid of road
types, whereas you are suggesting the lifecycle should be a dropdown
on every single one of the hundreds of thousands of normal roads.

 Not to mention you'd need to duplicate all the road types for every
 life cycle stage. You'd also need to add proposed railway, proposed
 cycleway, proposed foothpath, proposed track, proposed
 bridleway, proposed building, etc etc (and repeat for construction
 etc). Pretty messy, no?

Pretty unnecessary, imo. I think you're misunderstanding the current
purpose of the simple tab - providing a simple UI for the majority
of the mapping. Proposed buildings is pretty niche, and should be
incorporated in a way becoming of its niche-ness. Adding dropdowns
over every object for such a rare occurrence is the messy way.


Potlatch-dev mailing list

Re: [Potlatch-dev] How about another build?

2011-02-15 Thread Andy Allan
On Tue, Dec 28, 2010 at 1:30 PM, Steve Bennett wrote:

 Just checking before I implement this* and then find out there was
 another reason that I missed.

Ah, I've just done this a different way, and then read your email. Ho-hum!

 Also, what is the thinking around the text part of the icon element?
 It seems a bit under-developed. Perhaps a more explicit description
 element which explains what the entity represents (eg, text from the
 wiki), and a title or something which uses string substitution to
 summarise the entity?

There's already a description element for the feature, see e.g.
stream. I'm currently working on exposing this in the UI but I don't
think it's actually used anywhere at the moment.


Potlatch-dev mailing list

Re: [Potlatch-dev] Suggestion for lifecycle tag - comments?

2011-02-15 Thread Andy Allan
On Tue, Feb 15, 2011 at 10:31 PM, Steve Bennett wrote:
 Hi all,
  Thought I'd solicit comments before implementing the following:
    tag k=highway v=tertiary lifecycle=road/
    inputSet ref=road_lifecycle/

 inputSet id=road_lifecycle
  input type=choice presence=onTagMatch name=Life-cycle lifecycle=yes
    choice value= text=Complete description=Road is open for business./
    choice value=proposed text=Proposed description=Road has
 official approval, but construction has not started./
    choice value=construction text=Under construction
 description=Road is under construction./

 lifecycle id=road

 This would have the effect that highway=proposed, proposed=tertiary
 would get matched (thanks to the lifecycle definition). Selecting
 from a dropdown with lifecycle attribute set would cause the same
 split tag structure to be created (or removed). (That same attribute
 would cause the key attribute on the lifecycle element to get set to
 the tag on the feature that has the lifecycle attribute - a bit ugly)

 Anyway think the element names could be refined slightly. Are there
 any other tags that work this way, apart from the lifecycle ones? Do
 different tags have different lifecycles (I seem to recall that
 railways have more states). Should I just hard-code it all?

My first thought is to just have another couple of highway types ( a
proposed highway and a highway under construction ) with a list of
classifications in a choice input, and maybe some date inputs for when
they are opening and so on. That could all be done quite easily with
the current map_features code, and more importantly, there would be no
unnecessary UI for managing the lifecycle of the 99.999% of roads in
OSM that are neither proposed nor under construction.


Potlatch-dev mailing list

Re: [Potlatch-dev] What do the new cycleway values mean?

2011-02-03 Thread Andy Allan
On Thu, Feb 3, 2011 at 9:58 AM, Richard Fairhurst wrote:

 Potlatch is a conscious (collective) act of authorship, not really a
 democracy. You can't design coherent beginner-friendly software, or
 documentation, democratically - as the wiki sadly proves.

I think it's worth being cautious on adding things purely based on
their %age occurrences too - without checking how many people vs 1
automated import have created them, whether they are rendered or
something else is, even whether they make sense. Editorial judgement
is required here.


Who would like to see some judgement used in picking icons for the dnd
panel, mutter mutter!

Potlatch-dev mailing list

Re: [Potlatch-dev] What do the new cycleway values mean?

2011-02-03 Thread Andy Allan
On Thu, Feb 3, 2011 at 11:59 AM, Steve Bennett wrote:
 On Thu, Feb 3, 2011 at 9:31 PM, Dave Stubbs wrote:
 Segregated cycle path: A path where cyclists and pedestrians are
 separated by a painted line or kerb.

 Sounds an awful lot like cycleway=track to me.

 Shared cycle path: A path where cyclists and pedestrians share the
 full width of the path.

 That's what we, in Australia, call a bike path and tag
 highway=cycleway, foot=designated, bicycle=designated.

Aargh, what a lot of confusion. The cycleway=shared|segregated is an
option for standalone ways (either highway=cycleway or highway=path)
to indicate whether the bikes and pedestrians share the same tarmac.
In the UK there are two white-on-blue street signs - one with a man
and a bike beside one another with a white line between them (i.e.
segregated) and one with the man above the bike and no dividing line
(i.e. shared). There is a third sign (cycling only) but that can be
expressed by bicycle=yes foot=no etc.

for examples. I have no idea how common / consistent these signs are
around the world.

They can't really be used on road-type highways, since they clash with
the lane/track designation.

 Added by Shaun in December to get more accurate cycle path
 information for routing purposes (e.g. CycleStreets)

 That's all well and good for CycleStreets, but I'm iffy about having
 it in an international edition of Potlatch. It makes choosing the
 right cycleway tag absurdly difficult.

Users shouldn't need to worry about this. If they can pick various
options then the tags can be sorted out behind the scenes.

 Another issue here...why is a path where cyclists and pedestrians
 share the full width of the path an option on a *road*? Is it
 implying that in addition to the road, there is a parallel shared bike
 path? Eck...very unintuitive.

That sounds like it's in error, I can have a look at map features to
see what's going on.


Potlatch-dev mailing list

Re: [Potlatch-dev] What do the new cycleway values mean?

2011-02-03 Thread Andy Allan
On Thu, Feb 3, 2011 at 12:35 PM, Tom Hughes wrote:
 On 03/02/11 12:27, Steve Bennett wrote:

 Do tell? I'm probably guilty of whatever the crime is. Do you mean
 that the icons just look bad together (all different colours) or that
 they're badly drawn...or what?

 Well the Florist icon stands out like a sore thumb to start with - not
 only is it a different colour to almost all the other shopping icons
 but it is also a completely different shape.

 Other issues would be that Pharmacy is a different colour to other icons
 in the shopping section and there is no colour consistency at all in the
 amenity section.

 The weir icon in the water section is once again different to everything
 else in it's general style.

 The places section has five (yes, five) completely identical icons.

 I can also see about five which are just displaying a question mark so
 presumably the icon is missing.

 You honestly don't really need to be a graphic design genius to see what
 most of the problems are...

The missing icons are the ones that annoy me most - I carefully made
sure they all had icons at some point previously, and we've been
backsliding since then.


Potlatch-dev mailing list

Re: [Potlatch-dev] What do the new cycleway values mean?

2011-02-03 Thread Andy Allan
On Thu, Feb 3, 2011 at 12:27 PM, Steve Bennett wrote:

 Also, are we perhaps reaching the point where not all node features
 should be dnd's? For example, I don't think dnd highway=turning_circle
 is particularly useful...

Absolutely - there are also things that I'd like potlatch2 to
recognise when selected (e.g. country nodes) without encouraging
anyone to add more. We also have the issue that some of our point
tags are inappropriate for pois - e.g. turning_circle should be an
option for selectedwaynode but possibly not for selectedpoinode - but
the whole distinction between nodes and ways on one hand and pois,
points, lines and areas on the other is a little bit confused in p2 at
the moment.


Potlatch-dev mailing list

Re: [Potlatch-dev] On GPX tracks in P2

2010-12-06 Thread Andy Allan
On Sat, Dec 4, 2010 at 12:32 PM, NopMap wrote:

 You can set 1 or more GPX files to be loaded at startup using the
 vectors.xml config file, if that's what you're meaning:

 Not really. That file obviously is global for all users.

 In theory you could create it dynamically - in other words, depending
 what login cookies are set, use a CGI or PHP (or whatever) script to
 create vector.xml with the user's desired tracks in.

 Yes, but then it would still be a superset of all currently available user
 GPX tracks - or is there a way to dynamically assign various vector_.xml
 files to individual P2 instances when starting them?

I think you're missing what we're trying to explain. I'm assuming your
website supports sessions via cookies, or HTTP Basic auth, or some
other way - that would be needed to handle uploading GPX files to the
server in the first place. Given that then you can serve different
vectors.xml files to different people, in the same way that you serve
different html pages to different people. P2 requests its files via
the browser (that's how plugins work) so you would do something along
the lines of
* Get a request for vectors.xml
* Check the session information for that request, and figure out which
user is making it
* Figure out which GPX files are wanted for that user
* Build an XML object in memory
* Return that to the user as vectors.xml

It's very similar to what happens with the api/0.6/user/gpx_files call
which we use for the MyGPX dialog - there's nothing user-specific in
the URL, but each time it's called it returns a different list of GPX
files depending on who's authenticated for that call.


Potlatch-dev mailing list

Re: [Potlatch-dev] Internationalisation

2010-12-03 Thread Andy Allan
On Fri, Dec 3, 2010 at 8:54 AM, NopMap wrote:
 I noted that some parts are
 currently not easily translated as texts are both used as keys for
 references and shown to the user directly.

Are they? I thought all internal references to Category elements were
shown using the Category name rather than id. If you can give me
an example I can look at fixing this.


Potlatch-dev mailing list