jonasstein / scanaerial

Fuzzy Select plugin for JOSM
44 stars 12 forks source link

How to use custom urls (Particularly WMS) with ScanAerial #19

Closed aaronstar closed 9 years ago

aaronstar commented 9 years ago

Hi there, I have a custom wms urls (some of which are behind a password authentication) which presents data such as that shown in the image below.

How can I use ScanAerial to map this?

(P.s lakewalker blew up and is no longer working, tracer has never worked, ScanAerial seems to be the best thing)

fyi the url is:

wms:https://www2.landgate.wa.gov.au/ows/wmspublic?FORMAT=image/jpeg&VERSION=1.1.1&SERVICE=WMS&REQUEST=GetMap&LAYERS=LGATE-081&STYLES=&SRS={proj}&WIDTH={width}&HEIGHT={height}&BBOX={bbox}

I have modded my config file to now be:

[WMS] fixedzoomlevel = 11 server_api = wms server_name = www2.landgate.wa.gov.au: Building Footprints (LGATE-081) (18-10-2012 17:07:40) server_url = https://www2.landgate.wa.gov.au/ows/wmspublic?FORMAT=image/jpeg&VERSION=1.1.1&SERVICE=WMS&REQUEST=GetMap&LAYERS=LGATE-081&STYLES=& projection = EPSG:3857 tile_sizex = 256 tile_sizey = 256 [SCAN] douglas_peucker_epsilon = 0.60 deactivate_simplifying = 0 colour_str = 30 maxfilter_setting = 3 size_limit = 400 [TAGS] fixme = test

I'm a bit confused? Advice?

screenshot 2015-08-17 21 27 40

Vort commented 9 years ago

I can't test this URL because I don't know login&pass. scanaerial_auth_error But I guess that one of the problems can be with # symbols in config file

lines are commented out lines

so you need to remove comments where needed

aaronstar commented 9 years ago

@Vort

Hi Vort, thanks very much for your reply, much appreciated removing the #'s, I have now go the same error message as you :smile:

(The current cfg file appears to be text which is largely continuous without line changes, if it has no impact maybe a future update could make the cfg file use separtate lines for each text iteration - I'm using a cfg file dated 12th Jan 2015)

The new issue appears to be getting authorisation?

I also was editing a cfg file outside the C:/scanaerial/ directory without realising, which certainly didn't help and was a contributor to my inital issues

I forgot that that url is behind a password, and am unable to provide a password as the account is temporarily disabled (I forgot the password myself and exceeded logins as I use a password manager program) I may provide the password in future once I get the account up and running again (Have to send an email to reset it)

Vort commented 9 years ago

Config file do contain line changes But they are in Linux format If you look here https://github.com/jonasstein/scanaerial/blob/master/scanaerial.cfg , you will see that line breaks exists

Concerning authorization - you can try to embed login and password into the URL: http://username:password@example.com/

And one more thing - I hope you have permissions to import this data into OSM

aaronstar commented 9 years ago

My apologies, I wasn't aware the config file had line changes,

I managed to get it working! Using GeoServer as a proxy to pass-off the remote wms and authenticate there. (The url method did not work successfully)

Now however I am getting this error, from canvas.py (could not be loaded, blanking tile) https://github.com/jonasstein/scanaerial/blob/master/canvas.py.

after ScanAerial was working for a brief moment

I have tried selectively replacing the scanaerial directory with the zip files, and have only edited the config file.

C:\python27\python.exe C:\scanaerial\scanaerial.py -31.898008914135445 115.9724892628196 19.63133146067499 URL: http://localhost:8080/geoserver/wms?SERVICE=WMS&FORMAT=image/png&VERSION=1.1.1&SERVICE=WMS&REQUEST=GetMap&LAYERS=cite:LGATE-081&width=256&height=256&srs=EPSG:3857&bbox=12909908.3293,-3750000.60767,12910061.2033,-3749847.73361 Download took 5.07805895493 sec could not be loaded, blanking tile First walk (masking): 0.0359605960094 Colour table has 2 entries B/W MaxFilter: 0.00312845893059 could not be loaded, blanking tile Found 280 normales here. Second walk (leaving only poly): 0.0556024639043 line post-found; simplified to 41 Normales walk: 0.0633449689666,

The strange thing is geoserver appears to be working Ok (can't be sure) as I'm using this same url in JOSM layers, and nothing has appeared to change between when it was working and when it stopped working.

I really appreciate your response, and understand this may not be the best place to post, but found other forums diffcult to get responses from, and not many google results on the matter.

(Also I got email permission approving the use of selected data from these guys)

Vort commented 9 years ago

From your output, looks like program works fine. I want to investigate this problem further, but can't without access to tile server.

Vort commented 9 years ago

If you have external IP, you can just open 8080 port and post your IP here or send it to my e-mail: vvort@yandex.ru

If your IP is not accessible, then login&password needed.

aaronstar commented 9 years ago

Hi vort I have put my details in a plain text file at: Including IP, username and passw0rd :) Port 8080 redirects to the local computer's IP address

https://dl.dropbox user content.com/u/29846412/vort_temp2.txt (Remove two spaces)

im not sure what further details you may need, so let me know how I can help!

Vort commented 9 years ago

Here is working config (use fixed zoom feature of scanaerial): https://(removed) (If this URL fails - let me know - I will reupload file somewhere else)

And here is screenshot: scanaerial_works

Not perfect work, but fine for automatic tool And you can tweak settings further

Next I will try to get auth working

aaronstar commented 9 years ago

I'm really unsure of what the issue was with blanking tile, and do think it was an error on my behalf in the config. In anycase, you have fixed it !! :+1:

The orthangonalise shape tool and SimplifyArea plugin work to clean up most buildings from then on quite easily (I can understand the reasoning for possibly removing douglas peucker epsilon as discussed, from ScanAerial as a result)

I have provided the config file you provided as text here for future reference, let me know @Vort if you'd like me to remove it, additionally I will change the WMS dataset password once this issue is resolved, or after a little while, If you'd ever like access to this data in the future for any reason (It is for Western Australia only however) then let me know in this thread or otherwise and I'll give you a permanent password :)

[WMS] fixedzoomlevel = 22 server_api = wms server_name = www2.landgate.wa.gov.au: Building Footprints (LGATE-081) (18-10-2012 17:07:40) server_url = http://localhost:8080/geoserver/wms?SERVICE=WMS&FORMAT=image/png&VERSION=1.1.1&SERVICE=WMS&REQUEST=GetMap&LAYERS=cite:LGATE-081& projection = EPSG:3857 tile_sizex = 256 tile_sizey = 256

[SCAN] douglas_peucker_epsilon = 2.00 deactivate_simplifying = 0 colour_str = 20 maxfilter_setting = 1 size_limit = 800

[TAGS] building=yes

I really cannot thank you enough. Hopefully you can solve finding a way to authenticate within ScanAerial.

Vort commented 9 years ago

I think, problem was with incorrect zoom settings

Next I've made support for HTTP Auth: a2cc011ff6faa08357ae2b98ee11a6eb45ffd070 ( https://github.com/Vort/scanaerial/archive/http_auth.zip ) (remember to backup your config)

To enable it, you need to add two lines to config file: server_login = server_password =

But I think this will not help too much because direct connection to your server is too slow Maybe you need some layer of caching

(This change is not merged to main branch because I've deleted urllib support in this commit. Maybe this is unacceptable. I don't know)

Vort commented 9 years ago

I am closing this