# Question : How to draw land using its 4 points GPS coordinates?

**URL:** <https://forums.sketchup.com/t/question-how-to-draw-land-using-its-4-points-gps-coordinates/85950>\
**Category:** SketchUp\
**Created:** [January 21, 2019, 7:36am UTC](https://forums.sketchup.com/t/question-how-to-draw-land-using-its-4-points-gps-coordinates/85950 "2019-01-21T07:36:05Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![abd21995](https://avatars.discourse-cdn.com/v4/letter/a/e495f1/32.png) [@abd21995](https://forums.sketchup.com/u/abd21995)\
**Post date:** [January 21, 2019, 7:36am UTC](https://forums.sketchup.com/t/question-how-to-draw-land-using-its-4-points-gps-coordinates/85950/1 "2019-01-21T07:36:05Z")

</div>

Dear all,  
I have a problem and i hope you can help me. I want to know how to draw a land using its 4 points GPS coordinates.  
I have the coordinates of the border points of the land and i imported the location which includes it on Sketchup, but i cant find a way to draw my exact land borders using the GPS coordinates?

---

<div class="post-metadata">

**Author:** ![Aerilius](https://avatars.discourse-cdn.com/v4/letter/a/e19b73/32.png) [@Aerilius](https://forums.sketchup.com/u/Aerilius)\
**Post date:** [January 21, 2019, 8:57am UTC](https://forums.sketchup.com/t/question-how-to-draw-land-using-its-4-points-gps-coordinates/85950/2 "2019-01-21T08:57:12Z")

</div>

1. Open _Window → Ruby Console_
2. Replace the decimal coordinates in this snippet (in latitude, longitude order):

```ruby
coordinates = [
  [-105.270556, 40.015],
  [-105.270120, 40.015],
  [-105.270120, 40.016],
  [-105.270556, 40.016]
]
model = Sketchup.active_model
model.active_entities.add_face(coordinates.map{ |c| model.latlong_to_point(c) })

```

1. Paste and enter

---

<div class="post-metadata">

**Author:** ![abd21995](https://avatars.discourse-cdn.com/v4/letter/a/e495f1/32.png) [@abd21995](https://forums.sketchup.com/u/abd21995)\
**Post date:** [January 21, 2019, 11:06am UTC](https://forums.sketchup.com/t/question-how-to-draw-land-using-its-4-points-gps-coordinates/85950/3 "2019-01-21T11:06:04Z")

</div>

worked well !!! many thanks

---

<div class="post-metadata">

**Author:** ![JQL](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/jql/32/8074_2.png) [@JQL](https://forums.sketchup.com/u/JQL)\
**Post date:** [March 13, 2020, 1:43pm UTC](https://forums.sketchup.com/t/question-how-to-draw-land-using-its-4-points-gps-coordinates/85950/4 "2020-03-13T13:43:07Z")

</div>

Hi @Aerilius, I was trying to find a method to do exactly what you shared in this post and tried your snipet.

It was the best method yet, but my results are not right.

The thing is that I was able to convert GPS coordinates from DMS to DD and the data is right, but then when I use your code, the points are off.

I wonder if it has to do with my units settings. I’m using metric and your code might be for imperial?

I would really thank you if you could help me. Thanks in advance,

João

---

<div class="post-metadata">

**Author:** ![john\_drivenupthewall](https://avatars.discourse-cdn.com/v4/letter/j/c67d28/32.png) [@john\_drivenupthewall](https://forums.sketchup.com/u/john_drivenupthewall)\
**Post date:** [March 13, 2020, 2:05pm UTC](https://forums.sketchup.com/t/question-how-to-draw-land-using-its-4-points-gps-coordinates/85950/5 "2020-03-13T14:05:05Z")

</div>

try, converting :

```ruby
model.active_entities.add_face(coordinates.map{ |c|
 model.latlong_to_point(c.map(&:to_inch)) })

```

john

---

<div class="post-metadata">

**Author:** ![Aerilius](https://avatars.discourse-cdn.com/v4/letter/a/e19b73/32.png) [@Aerilius](https://forums.sketchup.com/u/Aerilius)\
**Post date:** [March 14, 2020, 5:55pm UTC](https://forums.sketchup.com/t/question-how-to-draw-land-using-its-4-points-gps-coordinates/85950/6 "2020-03-14T17:55:08Z")

</div>

In SketchUp we don’t design code for verious units. There is only one type of units that are internally used (and these are non-standard inch instead of SI units, but that’s another topic). We only need to convert user **input** , or convert internal units for user **display**.

The code snippet takes geocoordinates in decimal degrees (these are neither metric nor empirial) and converts them to SketchUp’s internal units. Then it tells SketchUp to draw a face from given coordinates in internal units. This seems consistent.

- Are you sure that you provide the **longitude** first, then the **latitude** (the method name is misleading)?

- What I could imagine is that the geocoordinates are in a different projection than the one that SketchUp uses. I didn’t figure out which projection SketchUp uses.
