Sign in to follow this  
x-plane 123

Ortho4XP help

Recommended Posts

Hi everyone,

 

I am in the processes of setting up Ortho4XP, but keep getting an IndentationError: unexpected indent, when typing in the from Ortho4XP_alpha1 import * and Ortho4XP('+45+006') commands. I think I have done everything according the instructions, so I'm not sure why it isn't working. Has anyone else come across this, and, if so, how did you fix it? 

Thanks for the help

 

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

I presume you're running on Windows?

 

When you open the python console, make sure you don't copy & paste, and remove any leading spaces of tabs, so it should be:

 

from Ortho4XP_alpha1 import *

 

and then on a seperate line

 

Ortho4XP('+45+006')

 

I've used alpha2 and although I can get it to run, it fails when it tries to download data from OpenStreetMap with an error.

Share this post


Link to post
Share on other sites

If I may help do not hesite to ask directly.

 

Present version is alpha3 (dropbox in my x-plane.fr signature, I have let

sourceforge down when they had permanent connection issues).

 

What do you mean by "it fails when it tries to download data from osm ?"

Do you have python 3 with the overpy module ?

 

I'll make the soft public with documentation when its characteristics are

stabilized, in a few weeks from now.

  • Upvote 1

Share this post


Link to post
Share on other sites

Hi Oscar

 

Great to see you here, and what a fantastic application you're creating.

 

I'm on a Mac, and have installed the required python modules including Python 3.. I was using the version from Sourceforge, I think it's alpha2. It tries to download polygons from OpenStreetMap for water, and then kept failing with timeouts. I'll try the later beta from your website and see if this works. 

 

Can I suggest github for hosting source code? I use it for my own projects and world-models, and have no problems with it.

Share this post


Link to post
Share on other sites

Your latest version from the Dropbox link is now working, it nows appeasr to be downloading and generating a tile in the UK. Looking forward to seeing the result (Will take ages on my connection)

Share this post


Link to post
Share on other sites

Google x-plane.fr and ortho4xp, you'll find a link and in Oscar's signature you'll see a dropbox link.

Share this post


Link to post
Share on other sites

Google x-plane.fr and ortho4xp, you'll find a link and in Oscar's signature you'll see a dropbox link.

 

Thanks tony

I can't seem to download 

Share this post


Link to post
Share on other sites

Tony- Yes, I'm using windows 7, but can try on my Mac too if necessary.

I tried what you suggested and was still getting the error (using alpha 2 from sourceforge)

 

Today I tried alpha3 and am getting the error " 'pip' is not recognized as an internal or external command, operable program, or batch file" when doing step 6.

When I type "Ortho4XP.py build_tile 45 6" I get the error, "ImportError: No module named 'numpy'

I'm using the default windows command prompt if that is of any importance.

If you need any more info, I'll be happy provide it.

 

P.s Thank you for creating this program Oscar! I'm looking forward to figuring out how to run it as it looks excellent.

Share this post


Link to post
Share on other sites

It's a complicated program to use at the moment, and I had to open the Python code files up to understand how to run it. Additionally, most of it is in French :-). However, I think Oscar has mentioned that once he stablises it, it will get proper instructions and will be more non-programmer friendly etc..

 

Anyway, I've successfully created a few tiles on Mac OS X using Alpha 3. I remember I had to do the following:

 

  • I installed Macbrew http://brew.sh/
  • I installed Python3 "brew install python3"
  • I then installed all the dependencies listed (There was no installer in Alpha 2, so I had to fix each error as it popped up), but you can now just run the installer "sh install/Mac64/Install_script.sh" and this should install all the dependencies Alpha 3 wants. If it doesn't, give me a shout and I'll help you through it.
  • Once installed, you then need to grab the DEM files for the region you want to generate. I grabbed mine from ViewFinderPanoramas and placed them into the Ortho4xp's Elevation_data folder. There are also tutorial videos on Youtube by Oscar on how to grab ones from the USGS server, but I prefer the viewfinder ones.
  • You then need to edit the file called Ortho4xp.cfg and add in a imagery layer you want to use. I use the following to add Google for all of the UK 
    ortho_list.append("49 60 -10 4 16 GO2")

    Basically this minLat, maxLat, minLon, maxLon, zoomLevel, service. The services currently being GO and GO2 for google (One uses newer imagery), BI for bing and then some French services.

  • You then run the command, on Mac OS X, I run 

    python3 Ortho4XP.py build_tile 50 1

    This will generate a tile for 50+001 (Somewhere around London). It took about 30 mins to generate a tile.

 

The quality of the tiles produced is superb, I especially like the fact that it uses OpenStreetMap to determine the coastline and water areas. So users can fix their own problems with the water in the mesh. However, one issue I did find is that the OpenStreetMap downloader is restricted to a certain size, so if a tile has a lot of water areas, the download fails and inland water (lakes, etc) don't have masks. I'll see if I can hack at the source code to fix this (i.e. Make it download smaller regions or read a readymade OSM file).

 

Also, I couldn't generate -53-001, I received an error with some non-existant number in the mesh. 

 

Good luck :-)

Share this post


Link to post
Share on other sites

Hi,

 

There are "detailed" installation instructions for the 3 OS in the Dropbox. They are probably in French now, but Google translate will help you.

 

Basically what you'll need is :

 

- Python 3 + the following modules : requests (for easy http), numpy (for easy arrays), overpy (for easy OSM), PIL or Pillow (for easy image manipulation), gdal [now optional, if not present I rely on PIL]. Installation of numpy and gdal is a little

bit more tricky on Windows than the otehr modules, since its not pure python but involves compiling C code (automatic though).

- Imagemagick >= 6.9 (you need a version with a jpeg and a dds delegates)

 

To test wether you have the prerequisities before using the program

1) type "convert" in a command window, if you get a help message from Imagemagick this is fine, if you get "file not found" or so its probably a PATH problem.

2) launch a python3 console and type "import requests, overpy, numpy, PIL". If this reports no error, and the first was ok too, you are on track to use Ortho4XP. If not you'll get issues if you try to use it.

 

For the graphical interface soon to be ready, you'll also need the 'tkinter' module (easy widgets).

 

@Tony (we cross-posted!)

 

The total construction time for a ZL16 tile is more like 15-20min here (the bottle neck being jepg->dds conversion at 1 every 4sec, and there are between 200 to 250 of them depending on latitude), but that may indeed depend on various parameters.

 

I am curious about what you mention with OSM limitation. I have not experienced that at all, and have tested the +51+004 and +52+004 which have huge amounts of OSM data for water (10 times more than average). The only limitation then is your RAM, since the overpy module is a bit inefficient on that (I can do the +51+004 on my 8Gb RAM computer but not on my 4Gb laptop), I will maybe skip overpy one day and replace it with wget and personal treatment of the xml osm data.

Edit : maybe I understand what you mean, this is the role of the parameter min_area (with it you let down every closed water way that has a surface smaller than min_area (in km^2)). Having an overlay for very small patches of water was not crucial I believed (since you have the orthophoto anyway and won't see nice reflections on such small pieces), and can make the mesh a bit more heavy, but you can put min_area=0 if you want every single water patch on OSM. 

 

Also, if you want to tweak overpy for speed, you can try the following (this goes in the __init__.py file of overpy, commented

lines are the original ones) :

 

#default_read_chunk_size = 8192
default_read_chunk_size = 131072

#self.url = "http://overpass-api.de/api/interpreter"
self.url = "http://api.openstreetmap.fr/oapi/interpreter"

 

the french oapi server is quicker but is only updated once a day, so if you make some changes on OSM (in partucular correct some errors of encroached segments) revert to the german one if you want to test thereafter. 

 

Regards,

Oscar

Share this post


Link to post
Share on other sites

Also, I couldn't generate -53-001, I received an error with some non-existant number in the mesh. 

 

Thanks for that one ! This is a division by zero bug for longitudes touching 0 or 180 (and maybe a few others...), I'll correct it in the day.

 

Other known possible issues (which are not bugs) are related to OSM errors (when two pieces of water overlap or when nodes are missing : the rule is that two segments must be either equal, disjoint, or have only one endpoint in common).

Correcting in OSM is the best fix of course, but possible overcomes are also to put no_small_angle=False and increase min_area (so that these buggy closed ways are discarded due to their too small area).

Share this post


Link to post
Share on other sites

Thanks for your help! 

I think I'm almost there. Hopefully the last problem I'm having is that I can't install numpy. I get some errors and message that says to install Microsoft visual C++ (which I have). I've been looking around, and none of the solutions I have found are working. Hopefully this is just something simple that I'm missing.

Share this post


Link to post
Share on other sites

Update:

I have a tile downloading now! I was able to download numpy using miniconda, then move the required files to the Python folder. Thank you again Oscar and Tony, I'm looking forward to seeing the results!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this