-
Notifications
You must be signed in to change notification settings - Fork 2
KML Getting started
Roly Hudson edited this page Jun 17, 2020
·
5 revisions
The current BHoM KML implementation allows pushing meshes with a default style to a KML file.
A simple demo file is available here (publicly accessible file needed)
The current implementation uses a simple hierarchy for the KML document.
The KMLDocumentBuilder object will create a single KML Document.
The document is structured with folders, each folder contains the contents of one KMLGeometry.
KMLGeometry is a group of BHoM IGeometry that share the same Geographic reference material.
Each folder in the KML document contains one KMLGeometry divided into one ot more Placemarks.
Each Placemark contains each of the BHoM IGeometry objects in the KMLGeometry.Geometries.
- Identify a recognisable point in your model (in the example this is the pitch centre)
- Locate the site in Google Earth
- Find the reference point
- Place mouse over reference point in Google Earth copy the latitude, longitude and altitude
- In google earth you first need to make sure you have a top view by clicking on the 2d/3d icon: Then click the compass icon to set north up:
- Zoom to fit the area you want and take a screen shot.
- Using Picture or PictureFrame in Rhino reference the image into the model.
- In the example we have a fairly good scaling reference - the football pitch, which we can assume to be 105 x 65.
- Rotate and scale the image to fit this in Rhino. If you have got the north arrow up the edge of the image will always provide a north-south reference.
- This allows you to model in a convenient orientation - not needing to use north up although you can do if you prefer.
- In this case the image does not align with the XY plane of the model. So the input NorthVector can be defined using the Reference (0,0,0 in this case) and a point perpendicular on the image edge.
- The Reference can be anywhere in the model that corresponds to the reference latitude longitude.
- If for some reason you don't have altitude (metres above sea-level) of your object you can try AltitudeMode.RelativeToGround which if Google Earth's estimate of the ground is nice and smooth should place your model on the surface of the earth. Although in practice it is rare to have a nice smooth section of ground and the result can be a bit wobbly.