I am developing a GIS application with java(Spring-4.1.5 + Hibernate-4.3.8) and OpenLayers. For this project I use GeoTools-13RC
, HibernateSptial-4.3
, jts-1.13
and jackson-2.5
.
In this project, I have a layer in client side and in server, I save the features of this layer in a class. I defined the class below:
@Entity
@Table(name="MyPoint")
public class MyPoint
{
@id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long Id;
@Column
private String name;
@Type(type = "org.hibernate.spatial.GeometryType")
@Column(name = "the_geom")
private Point geometry;
/*
*
Getter and Setter
*
*/
}
In start up of application, I need to init the layer in client side. for this, I need return from server side a json string to client for this layer. I don't want to use ST_AsGeoJson
or other matches. I use Spring REST controller for returning my Entity.
What do I do?