Jump to content

Creating Maps with CMAutoEditor


Butschi

Recommended Posts

40 minutes ago, IanL said:

Does this system assume 1080p screen?

Not explicitly. As long as the UI isn't scaled, i.e. if all pixel values are the same, you should be fine - worked for me when going from 1080p to 1440p. It won't work with Windows desktop scaling.

Link to comment
Share on other sites

2 hours ago, Butschi said:

Not explicitly. As long as the UI isn't scaled, i.e. if all pixel values are the same, you should be fine - worked for me when going from 1080p to 1440p. It won't work with Windows desktop scaling.

Humm. I do have my windows desktop scaled but I have that feature turned off for the game. Hopefully I get to play with this. I'll let you now if I do.

Link to comment
Share on other sites

12 hours ago, Butschi said:

Same way: https://geobroker.geobasis-bb.de/basiskarte.php?mode=startup&aProductId=140fca3b-18ba-49e5-928b-dc27ae522583

Next time its your turn to google, though. 😉 And please share your findings here.

Thanks Butschi! Iche sprechen kein Deutsch, I'm afraid. So far I have gotten as far as generating the rendered street map with objects. But for me the software Release does not launch. I get a big blue Windows message saying "Microsoft Defender SmartScreen prevented an unrecognized app from starting" and no option to run it using Windows 11.

Link to comment
Share on other sites

10 hours ago, samuraiman said:

Thanks Butschi! Iche sprechen kein Deutsch, I'm afraid. So far I have gotten as far as generating the rendered street map with objects. But for me the software Release does not launch. I get a big blue Windows message saying "Microsoft Defender SmartScreen prevented an unrecognized app from starting" and no option to run it using Windows 11.

I don't have Windows 11, so no way to test it. Sounds like a case of an overzealous virus scanner to me. I mean that's what defender does. Could also be a UAC problem: Windows doesn't like you to install it run uncertified apps from certain folder. So I guess you need to allow windows to execute the exe in some way. Anyway, nothing I could fix, I'm afraid.

Btw. I'm happy to help with data, it's just that if everyone wants me to find data for his favorite project, I'm busy doing nothing else. :D I'd really like this to be a community effort. 🙂 German administrative stuff is a royal PITA, I know, but Google translate actually does a decent job.

 

Link to comment
Share on other sites

Hello, 

Question regarding the data for elevation, maybe i miss it in one of the video but what format is needed for the elevation data exactly ? I'm trying to extract something from Bavaria(for an area east of nuremberg using https://geoportal.bayern.de/geoportalbayern/ and konwing the data type may help me find my way :D 

I guess it's "xyz" data but i'm not 100% confident and, are they named like that in general (i saw other names too). 

thanks you again for your work ! 

 

edt : Is it possible to only use the tool for bringing road and house and etc and not the elevation ?

 

Edited by Bartimeus
Link to comment
Share on other sites

4 hours ago, Bartimeus said:

Question regarding the data for elevation, maybe i miss it in one of the video but what format is needed for the elevation data exactly ? I'm trying to extract something from Bavaria(for an area east of nuremberg using https://geoportal.bayern.de/geoportalbayern/ and konwing the data type may help me find my way :D 

I guess it's "xyz" data but i'm not 100% confident and, are they named like that in general (i saw other names too). 

The product is DGM1, or "Digitales Geländemodell - Gitterweite 1 m" and you should look for something in ASCII format. It's often called "xyz". Look into the data, if it is just rows of number triples (x, y, z) you should be fine. Alternatively, you often find geotiff. You can use geotiff2cm.py instead of dgm2cm.py for that. However, currently I'd advise against it if you can find xyz. geotiff2cm.py is in need of some love as it lacks some of the functionality of dgm2cm.py. Didn't make the release cut. 🤷‍♂️

4 hours ago, Bartimeus said:

Is it possible to only use the tool for bringing road and house and etc and not the elevation ?

Yes, absolutely! The tool, osm2cm.py, is independent of elevations and produces .csv files that can be read by CMAutoEditor just like files with elevations in them.

Link to comment
Share on other sites

21 hours ago, Butschi said:

I wouldn't hold it against you if you waited for part 3 of the tutorial. 😉

I manage to have it started. Looking great. This is the best things happening to CM since the game was release. It change everything for me. 

Question, will it be (one day) possible to select the "pattern" for forest or field? Or is it too complicated and need to dive into the code? Regarlress, as I said, game changing and best things happening to CM! 

 

Edit : Do you have a list of all "Attribut/value" to "title" regarding the GeoJSON files. The data on my are limited and waaaay easier to complete it then having your sofware doing the job, but i was wondering which can of attribute/value it can "recognize" 

Edit 2 : Overlapping question, in which order do the sofware "color" the title ? For exemple if in my GeoJSON a forest polygone cover a field polygon which will overwrite the other ? (i'm not sure if i'm clear) ? 

Edited by Bartimeus
Link to comment
Share on other sites

6 hours ago, Bartimeus said:

I manage to have it started. Looking great. This is the best things happening to CM since the game was release. It change everything for me. 

Question, will it be (one day) possible to select the "pattern" for forest or field? Or is it too complicated and need to dive into the code? Regarlress, as I said, game changing and best things happening to CM! 

 

Edit : Do you have a list of all "Attribut/value" to "title" regarding the GeoJSON files. The data on my are limited and waaaay easier to complete it then having your sofware doing the job, but i was wondering which can of attribute/value it can "recognize" 

Edit 2 : Overlapping question, in which order do the sofware "color" the title ? For exemple if in my GeoJSON a forest polygone cover a field polygon which will overwrite the other ? (i'm not sure if i'm clear) ? 

Wow, that's great! I thought without tutorial nobody would dare to try. 🙂

I hope I'll find time this weekend to make part 3 of the tutorial and go into all the details. But just to give you the big picture: You can configure most of what is currently possible with the default_osm_config.json file. For instance, take a look at the entry "mixed_forest":

    "mixed_forest": {
        "tags": [
            ["landuse", "forest"],
            ["natural", "wood"]
        ],
        "exclude_tags": [
            ["leaf_type", "broadleaved"],
            ["leaf_type", "needleleaved"]
        ],
        "cm_types": [
            {"menu": "Foliage", "cat1": "Tree A", "cat2": "density 1", "weight": 1},
            {"menu": "Foliage", "cat1": "Tree A", "cat2": "density 2", "weight": 2},
            {"menu": "Foliage", "cat1": "Tree A", "cat2": "density 3", "weight": 1},
            {"menu": "Foliage", "cat1": "Tree B", "cat2": "density 1", "weight": 1},
            {"menu": "Foliage", "cat1": "Tree B", "cat2": "density 2", "weight": 2},
            {"menu": "Foliage", "cat1": "Tree B", "cat2": "density 3", "weight": 1},
            {"menu": "Foliage", "cat1": "Tree C", "cat2": "density 1", "weight": 1},
            {"menu": "Foliage", "cat1": "Tree C", "cat2": "density 2", "weight": 2},
            {"menu": "Foliage", "cat1": "Tree C", "cat2": "density 3", "weight": 1},
            {"menu": "Foliage", "cat1": "Tree D", "cat2": "density 1", "weight": 1},
            {"menu": "Foliage", "cat1": "Tree D", "cat2": "density 2", "weight": 2},
            {"menu": "Foliage", "cat1": "Tree D", "cat2": "density 3", "weight": 1},
            {"menu": "Foliage", "cat1": "Tree E", "cat2": "density 1", "weight": 1},
            {"menu": "Foliage", "cat1": "Tree E", "cat2": "density 2", "weight": 2},
            {"menu": "Foliage", "cat1": "Tree E", "cat2": "density 3", "weight": 1},
            {"menu": "Foliage", "cat1": "Tree F", "cat2": "density 1", "weight": 1},
            {"menu": "Foliage", "cat1": "Tree F", "cat2": "density 2", "weight": 2},
            {"menu": "Foliage", "cat1": "Tree F", "cat2": "density 3", "weight": 1},
            {"menu": "Foliage", "cat1": "Tree G", "cat2": "density 1", "weight": 1},
            {"menu": "Foliage", "cat1": "Tree G", "cat2": "density 2", "weight": 2},
            {"menu": "Foliage", "cat1": "Tree G", "cat2": "density 3", "weight": 1},
            {"menu": "Foliage", "cat1": "Tree H", "cat2": "density 1", "weight": 1},
            {"menu": "Foliage", "cat1": "Tree H", "cat2": "density 2", "weight": 2},
            {"menu": "Foliage", "cat1": "Tree H", "cat2": "density 3", "weight": 1},
            {"dummy": true, "weight": 1.6}            
        ],
        "process": [
            "type_random_individual"
        ],
        "priority": -1,
        "active": true
    }

"mixed_forest" is just a name for the entry. Under "tags" you find by which key-value pairs this entry is triggered. So, if in the geojson file there is something with landuse: forest in it, it will trigger this part if it doesn't have leaf_type: broadleaved or needleleaved in it. Maybe the closest thing to what you call a pattern would be the entry under "process". "type_random_individual" tells the program what to do with such an entry in the geojson file. "type_random_individual" says: Find every CM square that is covered to at least 50% by this forest polygon. For each square throw a dice and choose one of the "cm_types" (take the weight into account for throwing the dice, so something with weight 2 will be chosen twice as likely as something with weight 1. The "dummy" just means that with a certain weight no tree is planted in a square at all.

So right now you can only have random mixtures. Either random for each individual square or random for the entire area. If by "pattern" you mean something like, say a chess board, than that is something for which you'd have to dig into the code. My "vision" for forests is to have random clusters of trees, which would be most realistic, think. Actually, if you want to have something non-random it would probably be easiest to just do that with JOSM, I think and make entries in the default_osm_config.json (or make your own and call it differently. 😉) I mean, in JOSM you can paint an area an way you like, give it an arbitrary tag (key-value pair) and make an entry in default_osm_config.json which does the mapping of OSM to CM objects.

As for your about color ordering: That is done via the "priority" entry. If your field has priority 2 and your forest priority 1, the forest will be chosen if both a present in one place. Priorities 0 and -1 are a bit special. Hope I get it right off the top of my had... (no guarantees!) 0 means it doesn't "interact" with others at all. Meaning it will by painted in a square but won't prevent others from getting painted, too. Good thing for, say, grass as a base and then putting a road on top. -1 is similar. It won't prevent others from being painted but will not be painted itself if there is anything with priority > 0 present. Forest is one example. You can have forest ground in addition with priority 0 and you can have a road with priority, say, 1. The road will prevent the forest from getting painted at but there will still be forest ground.

Hope that helps a bit.

Link to comment
Share on other sites

Hello, 

It worked very fine for me. Now i manage to  understand how to modify well the GEOjson, it really speed up the process of making a map. A least while your software work i can do somehting else more nice and waaaay les tedious. Incredible job. 

So, if i understand it well, if i modify the   default_osm_config.json it could also work for a game like CMSF2 or is the position of the different catgorie is not the same in both editors ? 

Anyway, i'm a hudge fan ! 

Link to comment
Share on other sites

1 hour ago, Bartimeus said:

Hello, 

It worked very fine for me. Now i manage to  understand how to modify well the GEOjson, it really speed up the process of making a map. A least while your software work i can do somehting else more nice and waaaay les tedious. Incredible job. 

So, if i understand it well, if i modify the   default_osm_config.json it could also work for a game like CMSF2 or is the position of the different catgorie is not the same in both editors ? 

Anyway, i'm a hudge fan ! 

I'm still struggling with the tutorial so I'm very happy to hear that you manage without. 🙂

So, I can't really say much about how well CMSF2 would work with the current profile because I don't have that title. Anyway, in order to work well you need a dedicated profile. It looks like this for CMCW: https://github.com/DerButschi/CMAutoEditor/tree/master/profiles/cold_war

For one thing you need to know where which category is. Indeed, you could work around this a little by manipulating default_osm_config.json: Say, the menu entry in CMSF2 is "Road" and in CMCW you have "Foliage" at this position. Then you just put "Foliage" where in the cm_types of config entry "Road". Houses and such won't work if the houses are different, I think.

Of course, if python is your thing you could just make a CMSF2 profile. 😉

Link to comment
Share on other sites

I'm afraid of snake so I will leave Python to expert :) thanks for the answer. Once you understand the logic behind how your software work, the rest flow easy :)

I still will watch the tuto part 3 because I may miss one or two important detail ^^. For exemple can you confirm me that the "trees line" from the GEOjson is not taking into account by the software, right? 

Link to comment
Share on other sites

1 hour ago, Bartimeus said:

I'm afraid of snake so I will leave Python to expert :) thanks for the answer. Once you understand the logic behind how your software work, the rest flow easy :)

I still will watch the tuto part 3 because I may miss one or two important detail ^^. For exemple can you confirm me that the "trees line" from the GEOjson is not taking into account by the software, right? 

Can you please post which "trees line" you are referring to?

Link to comment
Share on other sites

5 hours ago, samuraiman said:

Hello Butschi,

I got as far as trying to generate the elevation map, following your excellent tutorials. But it seems my extra huge map crashes dgm2cm. The process during the crash shows TypeError: unsupported operand type...

IMG_0118.jpg

Nah, the size is not the issue here. Looks like a problem with the data... (floating point numbers were expected but a string appeared instead). Could you please tell me what data you used and which bounding boxes you entered and all that so I can try and reproduce the crash?

Link to comment
Share on other sites

9 hours ago, Butschi said:

Nah, the size is not the issue here. Looks like a problem with the data... (floating point numbers were expected but a string appeared instead). Could you please tell me what data you used and which bounding boxes you entered and all that so I can try and reproduce the crash?

Obtained xyz data via packet emailed from (sending to you by DM):

https://geobroker.geobasis-bb.de/basiskarte.php?mode=startup&aProductId=518094b9-d294-4e99-aeb2-550592a00682

 

go B.jpg

go A.jpg

go A2.jpg

go D2.jpg

Link to comment
Share on other sites

1 hour ago, samuraiman said:

Thanks for this very detailed bug report. Exactly the way it should be (well, as far as bug reports go... I could really do without them. 😉)

Alright, I was able to reproduce your error. Turns out that Brandenburg of course does its own thing. NRW and Hessen use space as delimiter between the numbers, Brandenburg uses comma. Federalism is so very useless!

At least it should be easy to fix. I'll have to finish a few other things first, though, so please have a little patience.

Btw. there is an additional issue with your input: The CRS of the data is 25833 not 25832. The relevant part for you here is that using 25832 sets the origin several hundred kilometers farther to west so that your bounding box and data won't match. I should have stressed that point a little more in the tutorial, I guess, and it was hard to find in the data (one of your meta files...).

Edited by Butschi
Link to comment
Share on other sites

I'm having trouble using the QGIS program. I'm trying to get aerial images for Grusselbach area(west of Hunfeld). I followed your instructions to the letter, but I press the 'add' button no aerial images appaer. Is it just that there aren't any images?

I tried other areas like Fulda and Hunfeld and still got no results.

One more thing, what's the name of the plugin in the Java OpenStreetMap Editor to import images? Your video tutorial didn't show that? 

Edited by nathangun
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...