A
A
Alex Raven2015-07-14 21:28:32
JavaScript
Alex Raven, 2015-07-14 21:28:32

How to draw features of a given size and orientation inside a polygon on a Google map?

In general, the problem is slightly non-trivial. The user himself draws a polygon on a Google map, in satellite mode. To be precise, it outlines the roof of the house. It can be either rectangular or have the shape of any polygon. One side of the polygon - the base line ("roof ridge"), determines the orientation in space. It is also set by the user. This part of the algorithm is implemented and works perfectly.
Further - more interesting. It is necessary to fill the drawn polygon with rectangles of a given size. These are solar panels, they have a size of 1 x 1.2 meters (but the size may change in the future). All solar panels are oriented in the same way as the baseline.
The task is to draw solar cells, and at the same time calculate the number that will fit on the roof. Has anyone faced a similar issue? I especially wonder how to scale the rectangles according to the coordinates of the polygon's vertices (an array of latitude - longitude values).
Here are the illustrations:
1. Polygon without panels
883329e954a5433aa1b600c4c7da8932.png
2. Polygon with panels
e0afcf97aca1494d9ba20bbca01bcdc4.png
3. Roof with real solar panels
d55ba7f79de4402c870b2e269bc1cb60.png

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question