-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
45 lines (32 loc) · 961 Bytes
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
---
layout: default
title: jeo
class: home
---
<div class="text-center">
<p class="lead">
jeo is an open-source library written in Java that provides low level spatial capabilities
</p>
{% highlight java %}
// create a point
Point p = Geom.point(-115.37, 51.08);
// reproject it
p = Proj.reproject(p, "epsg:4326", "epsg:900913");
// turn it into GeoJSON
String json = Geom.json(p);
// or turn it into a feature
Schema schema = Schema.build("towns").field("location", Point.class).schema();
// create a new postgis dataset
Workspace pg = PostGIS.open(new PostGISOpts("jeo"));
Cursor<Feature> c = pg.create(schema).cursor(new VectorQuery().append());
// add the point
Feature town = c.next();
town.put(p);
// write and close
c.write().close();
pg.close();
{% endhighlight %}
<!-- <p>
jeo is open source and licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0.html">Apache Version 2.0</a> license.
</p> -->
</div>