Post by statto on Aug 13, 2022 17:02:00 GMT -5
Hello everyone,
First post - couldn't find anything like this so apologies if I missed something.
I made my first fictional course using QGIS/JOSM/Chad Rockey's TGC Designer tool today and it turned out both very quickly and amazingly well, and I wanted to share a few tips and tricks, though it's pretty advanced.
First I created a polygon shapefile at the fictional latitude I wanted to create the course at - longitude doesn't really matter, and used the measuring tool to get a rough outline of a course boundary. The polygon shapefile had two fields: "id" (integer) and "golf" (string). Call the column "golf" because the shapefile would later be turned into an OSM file, and this hosts all the layers you would sketch out in OSM. (Note I didn't get water to work.)
Then, sketch out your course in QGIS using the OSM tags for a golf course to tag the features. However, you can call the polygons whatever you want. For the forested areas, I used "wood."
Once the course was finished, I decided to create a separate trees layer. I went to the Vector menu > Research > Regular Points, specified about 48 feet between each tree, specified a random offset, and made sure the this was bounded to the golf course shapefile. This generates a random but regular grid of points which we're going to turn into trees.
Remember the "wood" for the forested areas? Select all of those (you can select all of these features pretty easily using the attributes table) and then save all those selected areas as a new separate temporary shapefile. Once that's done, you can select all of the tree points within this new shapefile at the Vector > Research > Select by Location and intersect the wood polygon with the points. (Make sure intersect is checked.) You can now save this selection as a new layer or invert the selection and delete all the other points. You now have your trees layer.
From there, you can edit the trees point layer easily in QGIS - if two trees were placed too close to each other or you want to plant more trees elsewhere, it's very easy to do, much easier than planting! However, I'm not entirely sure how to specify tree varieties this way.
Once you're happy with both your trees shapefile and your golf course shapefile, open both shapefiles in JOSM. With the trees layer, select every single point (node in JOSM) and make sure they're all tagged as natural=tree. Then merge the two shapefiles together in the layers menu and export as an .osm file!
There's one more step before TGC will recognise the file - you need to add the <bounds> tag to the .osm file. Open the .osm file in Notepad and enter the following line:
<bounds minlat='' maxlat='' minlon='' maxlon='' />
You will have to manually fill in each value with the extent of your shapefile. You don't have to be exactly precise, but too narrow and you will lose data, and too broad and the golf course may not be centred correctly. If you don't do this step, TGC will hang looking for this line!
A completed line will look something like:
<bounds minlat='31.405591' maxlat='31.608104' minlon='-119.046291' maxlon='-119.00123' />
Then create a new course like normal in TGC - you'll probably want to make sure the theme is correct first because trees are being imported - and then select the "create flat course from OSM file" and make sure the trees box is checked. Your new fictional course should come up!
When you load it into the TGC 2k19 editor, you'll notice the vast majority of your planting has been done (though understanding tree varietals will help tremendously) - all that's left is elevations and fine-tuning the planting.
I was able to almost complete a beta version of a course in only a few hours today, mostly because this method does the planting for you, and the random offset points works really well for creating a realistic-feeling plant. The course also imported fantastically well and you should be able to get a fine level of detail if you put in the effort.
Many steps involved, but I hope someone else finds this useful. Good luck!