The Poly Object gives you access to millions Admin borders and shapes, from the OpenStreetmap database.
Usage
- The Poly Object requires a DEM Earth object somewhere in the parent hierarchy.
- Best is to insert it under a pin, which is under your dem earth object, but you don't ave to.
- The DEM Earth area is used to limit the search query area.
- When you query an area, a list of level groups is created as user data buttons, with the name of each border found, sorted by level and name. At this point, no borders have been created. i.e..
- All that has happened so far, is that the database has been queried for border id's in your area of interest.the id and name of those borders have been sorted into something manageable within the context of a Cinema4D dialog interface. A query can produce a LOT of results, so don't go trying to query half the planet, as it might be a bit much for Cinema 4D to handle.
- Its easy to get hundreds or thousands of results. If you get a a lot, use the object manager search tool to try to limit what you see, and fold the level groups your not interested in.
Once you have populated the object with borders, simply click on any border (user data) button to download, and show that correct border for that ID. The camera will center on the new border. It may need to generate a border if none exists, taking a bit longer to return a result. Once downloaded, the borders are cached, and re-used if needed again (as are the queries you make).
Object Properties
- Query region for boundaries : Queries the dem earth parent region for any boundaries which overlap the area. Depending on the size of the area, this may take several seconds.
- Multi Polygon Query : Runs a query for things like lakes or rivers, using the Poly Query Filter as the search criteria. This uses the same same argument method as the osm object. Typical searches can be things like natural or water. These tags and their values can be combined to narrow down the search results.
- Load a Poly File :. If you have a specific poly file, load it using this button.
- Load a GPX file : select a gpx file to import. This replaces the previous drag drop functionality and is much more useful.
- Create An Alpha Mask : This button creates an aliased alpha image, puts that image in a new material's alpha channel. it then places that material on the parent dem earth object and maps it using a georeference tag. A semi random color is used in the color channel, based on the name,level and location of the border. This gives each poly border a unique individual color and the image mask created has a unique name.
- Create an Image & Alpha : This button creates an image from your Map loader settings, and an Alpha mask for it, from the active poly border.
in the material it creates, you can easily invert the mask from the material alpha channel.
Settings
- Point Reduction : Some of the admin borders have an awful lot of points... that can be a problem if you want to use extruder to polygonize, or sweep. The point reduction setting uses a very clever algorithm to reduce the number of points in the spline, with minimal visual impact. Give it a try, you will be surprised at how good this secret little feature is :)
- Build Only the Primary Segment : Polygons can be made of multiple segments. This setting tells the Poly object to build only the largest, primary segment.
- Calculate Height : If this is Enabled, the poly object calculates the physical height of each point in the spline, from the dem earth parent. Turning this off has the effect of speeding up calculation, and flatting the spline.
- Set Object Name : If Enabled, this will change the Poly Objects name, to the name of the border you select.
- Poly Query filter : An additional filter name for the Multi Polygon Query command. As per OSM query language. This is useful for example, if you want to find specific things that are not an admin border, but are a Multi Polygon shape. i.e. lakes o rivers.
- Additional Points : Sometimes an admin border can have lines, with just a few points, that cover a large distance. You might want additional points to be added. This is how you can do that.
Tips
- there are some examples of POLY files, here : https://c4d.freshdesk.com/en/support/solutions/4000003704
- the QUERY field is much the same as an OSM query...
- Details of the poly format can be found here https://wiki.openstreetmap.org/wiki/Osmosis/Polygon_Filter_File_Format
- Hold and press the Alt key (options button on mac) to open a location on the openstreetmap.org website.
- If you have too many results, you can easily open the objects userdata manger on the object, and delete the items or groups you do not want to see.