初始化

This commit is contained in:
hukekuan@163.com 2018-01-29 14:51:32 +08:00
parent ac0dfedd2c
commit d389b52b66
24 changed files with 117 additions and 612 deletions

View File

@ -2,12 +2,20 @@ package com.gis3c.ol.dao;
import com.gis3c.common.persistence.annotation.C3olDao;
import com.gis3c.ol.entity.Layer;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* Created by hukekuan on 2017/12/15.
*/
@C3olDao
public interface LayerDao {
public List<Layer> findAllList();
public List<Layer> findLayersByPage(
@Param("pageSize") Integer pageSize,
@Param("currentPage") Integer currentPage);
public Layer findeLayerById(String layerId);
public Layer findeLayerByName(String layerName);

View File

@ -12,7 +12,7 @@ import java.util.List;
@C3olDao
public interface MapDao {
public List<Map> findAllList();
public List<Map> findMapsByByPage(
public List<Map> findMapsByPage(
@Param("pageSize") Integer pageSize,
@Param("currentPage") Integer currentPage);

View File

@ -2,10 +2,7 @@ package com.gis3c.ol.dao;
import com.gis3c.common.persistence.annotation.C3olDao;
import com.gis3c.ol.entity.Source;
import com.gis3c.ol.entity.source.TileArcGISRest;
import com.gis3c.ol.entity.source.TileSuperMapRest;
import com.gis3c.ol.entity.source.Vector;
import com.gis3c.ol.entity.source.Wmts;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -14,32 +11,11 @@ import java.util.List;
*/
@C3olDao
public interface SourceDao {
public TileArcGISRest findTileArcGISRestById(String sourceId);
public TileArcGISRest findTileArcGISRestByName(String sourceName);
public Integer insertTileArcGISRest(TileArcGISRest tileArcGISRest);
public TileSuperMapRest findTileTileSuperMapRestById(String sourceId);
public TileSuperMapRest findTileTileSuperMapRestByName(String sourceName);
public Integer insertTileSuperMapRest(TileSuperMapRest tileSuperMapRest);
public Vector findVectorById(String sourceId);
public Vector findVectorByName(String sourceName);
public Integer insertVector(Vector vector);
public Wmts findWmtsById(String sourceId);
public Wmts findWmtsByName(String sourceName);
public Integer insertWmts(Wmts wmts);
public List<Source> findAllSources();
public void insertSource(Source source);
public List<Source> findAllList();
public List<Source> findSourcesByPage(
@Param("pageSize") Integer pageSize,
@Param("currentPage") Integer currentPage);
public Source findSourceById(String sourceId);
public Source findSourceByName(String sourceName);
public Integer insertSource(Source source);
}

View File

@ -1,70 +0,0 @@
package com.gis3c.ol.entity.source;
/**
* Created by hukekuan on 2017/12/14.
*/
public class TileArcGISRest {
private String sourceId;
private String sourceName;
private String crossOrigin;
private String projection;
private String url;
private Boolean wrapX;
private String description;
public String getSourceId() {
return sourceId;
}
public void setSourceId(String sourceId) {
this.sourceId = sourceId;
}
public String getSourceName() {
return sourceName;
}
public void setSourceName(String sourceName) {
this.sourceName = sourceName;
}
public String getCrossOrigin() {
return crossOrigin;
}
public void setCrossOrigin(String crossOrigin) {
this.crossOrigin = crossOrigin;
}
public String getProjection() {
return projection;
}
public void setProjection(String projection) {
this.projection = projection;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public Boolean getWrapX() {
return wrapX;
}
public void setWrapX(Boolean wrapX) {
this.wrapX = wrapX;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
}

View File

@ -1,61 +0,0 @@
package com.gis3c.ol.entity.source;
/**
* Created by hukekuan on 2017/12/14.
*/
public class TileSuperMapRest {
private String sourceId;
private String sourceName;
private String url;
private Boolean wrapX;
private Boolean opaque;
private String description;
public String getSourceId() {
return sourceId;
}
public void setSourceId(String sourceId) {
this.sourceId = sourceId;
}
public String getSourceName() {
return sourceName;
}
public void setSourceName(String sourceName) {
this.sourceName = sourceName;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public Boolean getWrapX() {
return wrapX;
}
public void setWrapX(Boolean wrapX) {
this.wrapX = wrapX;
}
public Boolean getOpaque() {
return opaque;
}
public void setOpaque(Boolean opaque) {
this.opaque = opaque;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
}

View File

@ -1,72 +0,0 @@
package com.gis3c.ol.entity.source;
import com.sun.org.apache.xpath.internal.operations.Bool;
/**
* Created by hukekuan on 2017/12/14.
*/
public class Vector {
private String sourceId;
private String sourceName;
private Boolean logo;
private String url;
private Boolean useSpatialIndex;
private Boolean wrapX;
private String description;
public String getSourceId() {
return sourceId;
}
public void setSourceId(String sourceId) {
this.sourceId = sourceId;
}
public String getSourceName() {
return sourceName;
}
public void setSourceName(String sourceName) {
this.sourceName = sourceName;
}
public Boolean getLogo() {
return logo;
}
public void setLogo(Boolean logo) {
this.logo = logo;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public Boolean getUseSpatialIndex() {
return useSpatialIndex;
}
public void setUseSpatialIndex(Boolean useSpatialIndex) {
this.useSpatialIndex = useSpatialIndex;
}
public Boolean getWrapX() {
return wrapX;
}
public void setWrapX(Boolean wrapX) {
this.wrapX = wrapX;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
}

View File

@ -1,79 +0,0 @@
package com.gis3c.ol.entity.source;
/**
* Created by hukekuan on 2017/12/14.
*/
public class Wmts {
private String sourceId;
private String sourceName;
private String url;
private String layer;
private String style;
private String format;
private String matrixSet;
private String description;
public String getSourceId() {
return sourceId;
}
public void setSourceId(String sourceId) {
this.sourceId = sourceId;
}
public String getSourceName() {
return sourceName;
}
public void setSourceName(String sourceName) {
this.sourceName = sourceName;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getLayer() {
return layer;
}
public void setLayer(String layer) {
this.layer = layer;
}
public String getStyle() {
return style;
}
public void setStyle(String style) {
this.style = style;
}
public String getFormat() {
return format;
}
public void setFormat(String format) {
this.format = format;
}
public String getMatrixSet() {
return matrixSet;
}
public void setMatrixSet(String matrixSet) {
this.matrixSet = matrixSet;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
}

View File

@ -1,7 +0,0 @@
package com.gis3c.ol.entity.style;
/**
* Created by hukekuan on 2017/12/14.
*/
public class Circle {
}

View File

@ -1,7 +0,0 @@
package com.gis3c.ol.entity.style;
/**
* Created by hukekuan on 2017/12/14.
*/
public class Fill {
}

View File

@ -1,7 +0,0 @@
package com.gis3c.ol.entity.style;
/**
* Created by hukekuan on 2017/12/14.
*/
public class Icon {
}

View File

@ -1,7 +0,0 @@
package com.gis3c.ol.entity.style;
/**
* Created by hukekuan on 2017/12/14.
*/
public class RegularShape {
}

View File

@ -1,7 +0,0 @@
package com.gis3c.ol.entity.style;
/**
* Created by hukekuan on 2017/12/14.
*/
public class Stroke {
}

View File

@ -1,61 +0,0 @@
package com.gis3c.ol.entity.style;
/**
* Created by hukekuan on 2017/12/14.
*/
public class Style {
private String styleId;
private String getStyleName;
private String fill;
private String image;
private String stroke;
private String text;
public String getStyleId() {
return styleId;
}
public void setStyleId(String styleId) {
this.styleId = styleId;
}
public String getGetStyleName() {
return getStyleName;
}
public void setGetStyleName(String getStyleName) {
this.getStyleName = getStyleName;
}
public String getFill() {
return fill;
}
public void setFill(String fill) {
this.fill = fill;
}
public String getImage() {
return image;
}
public void setImage(String image) {
this.image = image;
}
public String getStroke() {
return stroke;
}
public void setStroke(String stroke) {
this.stroke = stroke;
}
public String getText() {
return text;
}
public void setText(String text) {
this.text = text;
}
}

View File

@ -3,10 +3,15 @@ package com.gis3c.ol.service;
import com.gis3c.ol.entity.Layer;
import java.util.List;
/**
* Created by hukekuan on 2017/12/15.
*/
public interface LayerService {
public List<Layer> findAllList();
public List<Layer> findLayersByPage(Integer pageSize,Integer currentPage);
public Layer findeLayerById(String layerId);
public Layer findeLayerByName(String layerName);

View File

@ -9,7 +9,7 @@ import java.util.List;
*/
public interface MapService {
public List<Map> findAllList();
public List<Map> findMapsByByPage(Integer pageSize,Integer currentPage);
public List<Map> findMapsByPage(Integer pageSize,Integer currentPage);
public Map findMapById(String mapId);
public Map findMapByName(String mapName);

View File

@ -1,44 +1,15 @@
package com.gis3c.ol.service;
import com.gis3c.ol.entity.Source;
import com.gis3c.ol.entity.source.TileArcGISRest;
import com.gis3c.ol.entity.source.TileSuperMapRest;
import com.gis3c.ol.entity.source.Vector;
import com.gis3c.ol.entity.source.Wmts;
import java.util.List;
/**
* Created by hukekuan on 2017/12/15.
*/
public interface SourceService {
public TileArcGISRest findTileArcGISRestById(String sourceId);
public TileArcGISRest findTileArcGISRestByName(String sourceName);
public Integer insertTileArcGISRest(TileArcGISRest tileArcGISRest);
public TileSuperMapRest findTileTileSuperMapRestById(String sourceId);
public TileSuperMapRest findTileTileSuperMapRestByName(String sourceName);
public Integer insertTileSuperMapRest(TileSuperMapRest tileSuperMapRest);
public Vector findVectorById(String sourceId);
public Vector findVectorByName(String sourceName);
public Integer insertVector(Vector vector);
public Wmts findWmtsById(String sourceId);
public Wmts findWmtsByName(String sourceName);
public Integer insertWmts(Wmts wmts);
public List<Source> findAllSources();
public void insertSource(Source source);
public List<Source> findAllList();
public List<Source> findSourcesByPage(Integer pageSize,Integer currentPage);
public Source findSourceById(String sourceId);
public Source findSourceByName(String sourceName);
public Integer insertSource(Source source);
}

View File

@ -6,6 +6,9 @@ import com.gis3c.ol.service.LayerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.UUID;
/**
* Created by hukekuan on 2017/12/15.
*/
@ -14,6 +17,16 @@ public class LayerServiceImpl implements LayerService {
@Autowired
private LayerDao layerDao;
@Override
public List<Layer> findAllList() {
return layerDao.findAllList();
}
@Override
public List<Layer> findLayersByPage(Integer pageSize, Integer currentPage) {
return layerDao.findLayersByPage(pageSize,(currentPage -1)*pageSize);
}
@Override
public Layer findeLayerById(String layerId) {
return layerDao.findeLayerById(layerId);
@ -26,6 +39,7 @@ public class LayerServiceImpl implements LayerService {
@Override
public Integer insertLayer(Layer layer) {
layer.setLayerId(UUID.randomUUID().toString());
return layerDao.insertLayer(layer);
}
}

View File

@ -7,6 +7,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.UUID;
/**
* Created by hukekuan on 2017/12/14.
@ -22,8 +23,8 @@ public class MapServiceImpl implements MapService {
}
@Override
public List<Map> findMapsByByPage(Integer pageSize,Integer currentPage) {
return mapDao.findMapsByByPage(pageSize,currentPage);
public List<Map> findMapsByPage(Integer pageSize,Integer currentPage) {
return mapDao.findMapsByPage(pageSize,(currentPage -1)*pageSize);
}
@Override
@ -38,6 +39,7 @@ public class MapServiceImpl implements MapService {
@Override
public Integer insertMap(Map map) {
map.setMapId(UUID.randomUUID().toString());
return mapDao.insertMap(map);
}
}

View File

@ -2,15 +2,12 @@ package com.gis3c.ol.service.impl;
import com.gis3c.ol.dao.SourceDao;
import com.gis3c.ol.entity.Source;
import com.gis3c.ol.entity.source.TileArcGISRest;
import com.gis3c.ol.entity.source.TileSuperMapRest;
import com.gis3c.ol.entity.source.Vector;
import com.gis3c.ol.entity.source.Wmts;
import com.gis3c.ol.service.SourceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.UUID;
/**
* Created by hukekuan on 2017/12/15.
@ -21,72 +18,28 @@ public class SourceServiceImpl implements SourceService {
private SourceDao sourceDao;
@Override
public TileArcGISRest findTileArcGISRestById(String sourceId) {
return sourceDao.findTileArcGISRestById(sourceId);
public List<Source> findAllList() {
return sourceDao.findAllList();
}
@Override
public TileArcGISRest findTileArcGISRestByName(String sourceName) {
return sourceDao.findTileArcGISRestByName(sourceName);
public List<Source> findSourcesByPage(Integer pageSize, Integer currentPage) {
return sourceDao.findSourcesByPage(pageSize,(currentPage -1)*pageSize);
}
@Override
public Integer insertTileArcGISRest(TileArcGISRest tileArcGISRest) {
return sourceDao.insertTileArcGISRest(tileArcGISRest);
public Source findSourceById(String sourceId) {
return sourceDao.findSourceById(sourceId);
}
@Override
public TileSuperMapRest findTileTileSuperMapRestById(String sourceId) {
return sourceDao.findTileTileSuperMapRestById(sourceId);
public Source findSourceByName(String sourceName) {
return sourceDao.findSourceByName(sourceName);
}
@Override
public TileSuperMapRest findTileTileSuperMapRestByName(String sourceName) {
return sourceDao.findTileTileSuperMapRestByName(sourceName);
}
@Override
public Integer insertTileSuperMapRest(TileSuperMapRest tileSuperMapRest) {
return sourceDao.insertTileSuperMapRest(tileSuperMapRest);
}
@Override
public Vector findVectorById(String sourceId) {
return sourceDao.findVectorById(sourceId);
}
@Override
public Vector findVectorByName(String sourceName) {
return sourceDao.findVectorByName(sourceName);
}
@Override
public Integer insertVector(Vector vector) {
return sourceDao.insertVector(vector);
}
@Override
public Wmts findWmtsById(String sourceId) {
return sourceDao.findWmtsById(sourceId);
}
@Override
public Wmts findWmtsByName(String sourceName) {
return sourceDao.findWmtsByName(sourceName);
}
@Override
public Integer insertWmts(Wmts wmts) {
return sourceDao.insertWmts(wmts);
}
@Override
public List<Source> findAllSources() {
return sourceDao.findAllSources();
}
@Override
public void insertSource(Source source) {
sourceDao.insertSource(source);
public Integer insertSource(Source source) {
source.setSourceId(UUID.randomUUID().toString());
return sourceDao.insertSource(source);
}
}

View File

@ -1,6 +1,7 @@
package com.gis3c.spatial;
import com.gis3c.ol.entity.Layer;
import com.gis3c.ol.entity.Source;
import com.gis3c.ol.service.LayerService;
import com.gis3c.ol.service.MapService;
import com.gis3c.ol.service.SourceService;
@ -9,6 +10,8 @@ import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.UUID;
/**
@ -24,25 +27,25 @@ public class App {
SourceService sourceService = context.getBean(SourceService.class);
LayerService layerService = context.getBean(LayerService.class);
MapService mapService = context.getBean(MapService.class);
TestService testService = context.getBean(TestService.class);
// List<Source> sources = sourceService.findAllSources();
// System.out.println(sources.get(0).getParams());
// Source source = sourceService.findSourceByName("cva");
// System.out.println(source.getOptions());
//
// Source newSource = new Source();
// newSource.setSourceId("44");
// newSource.setSourceName("44");
// newSource.setUrl("444");
// newSource.setSourceName("sdkqbigdata");
// newSource.setType("ol.source.TileArcGISRest");
// java.util.Map<String, Object> params = new HashMap<>();
// params.put("bar","444");
// params.put("active",true);
// params.put("balance",4.444);
// params.put("center",new Integer[]{1,2});
// newSource.setParams(params);
// newSource.setDescription("555");
// params.put("url","http://58.56.98.79:8003/ArcGIS/rest/services/sdkqbigdata1/MapServer");
//
// newSource.setOptions(params);
// newSource.setDescription("山东省行政区图");
//
// sourceService.insertSource(newSource);
// System.out.println("插入成功");
// List<Map> mapList = mapService.findMapsByByPage(10,0);
@ -83,13 +86,15 @@ public class App {
// System.out.println("插入成功");
//图层接口
Layer wmtsLayer = new Layer();
wmtsLayer.setLayerId(UUID.randomUUID().toString());
wmtsLayer.setLayerName("cva");
wmtsLayer.setAliasName("全国行政区图层");
wmtsLayer.setSource("b2729474-5988-410c-b6a0-8834b19d5832");
wmtsLayer.setType("ol.layer.Tile");
layerService.insertLayer(wmtsLayer);
Layer layer = new Layer();
layer.setLayerName("streetmap");
layer.setAliasName("超图行政区图");
layer.setSource("d7cb5f6f-ee31-4a6e-b8fd-72603a066c2b");
layer.setType("ol.layer.Tile");
java.util.Map<String,Object> options = new HashMap<>();
options.put("projection","EPSG:4326");
layer.setOptions(options);
layerService.insertLayer(layer);
System.out.println("插入成功");

View File

@ -33,6 +33,18 @@
, description
</sql>
<select id="findAllList" resultMap="layerResult">
SELECT
<include refid="layerColumns"/>
FROM c3gis_ol_layer;
</select>
<select id="findLayersByPage" resultMap="layerResult">
SELECT
<include refid="layerColumns"/>
FROM c3gis_ol_layer
limit #{pageSize, javaType=java.lang.Integer}
offset #{currentPage, javaType=java.lang.Integer};
</select>
<select id="findeLayerById" resultMap="layerResult">
SELECT

View File

@ -33,7 +33,7 @@
FROM c3gis_ol_map;
</select>
<select id="findMapsByByPage" resultMap="mapResult">
<select id="findMapsByPage" resultMap="mapResult">
SELECT
<include refid="mapColumns"/>
FROM c3gis_ol_map

View File

@ -17,11 +17,32 @@
, description
</sql>
<select id="findAllSources" resultMap="sourceResult">
<select id="findAllList" resultMap="sourceResult">
SELECT
<include refid="sourceColumns"/>
FROM c3gis_ol_source;
</select>
<select id="findSourcesByPage" resultMap="sourceResult">
SELECT
<include refid="sourceColumns"/>
FROM c3gis_ol_source
limit #{pageSize, javaType=java.lang.Integer}
offset #{currentPage, javaType=java.lang.Integer};
</select>
<select id="findSourceById" resultMap="sourceResult">
SELECT
<include refid="sourceColumns"/>
FROM c3gis_ol_source
WHERE sourceId = #{sourceId, javaType=java.lang.String};
</select>
<select id="findSourceByName" resultMap="sourceResult">
SELECT
<include refid="sourceColumns"/>
FROM c3gis_ol_source
WHERE sourceName = #{sourceName, javaType=java.lang.String};
</select>
<insert id="insertSource" parameterType="com.gis3c.ol.entity.Source">
INSERT INTO c3gis_ol_source(sourceId
, sourceName

View File

@ -1,84 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.gis3c.ol.dao.ViewDao">
<resultMap id="viewResult" type="com.gis3c.ol.entity.View">
<result property="viewId" column="viewid" />
<result property="viewName" column="viewname" />
<result property="center" column="center" javaType="ObjectArray"/>
<result property="extent" column="extent" javaType="ObjectArray"/>
<result property="minResolution" column="minresolution" />
<result property="maxZoom" column="maxzoom" />
<result property="minZoom" column="minzoom" />
<result property="zoom" column="zoom" />
<result property="projection" column="projection" />
<result property="resolution" column="resolution" />
<result property="resolutions" column="resolutions" javaType="ObjectArray"/>
<result property="rotation" column="rotation" />
<result property="description" column="description" />
</resultMap>
<sql id="viewColumns">
viewid
, v.viewname
, v.center
, v.extent
, v.maxresolution
, v.minresolution
, v.maxzoom
, v.minzoom
, v.zoom
, v.projection
, v.resolution
, v.resolutions
, v.rotation
, v.description
</sql>
<select id="findeViewById" resultMap="viewResult">
SELECT
<include refid="viewColumns"/>
FROM c3gis_ol_view v
WHERE v.viewid = #{viewId, javaType=java.lang.String};
</select>
<select id="findeViewByName" resultMap="viewResult">
SELECT
<include refid="viewColumns"/>
FROM c3gis_ol_view v
WHERE v.viewname = #{viewName};
</select>
<insert id="insertView" parameterType="com.gis3c.ol.entity.View">
INSERT INTO c3gis_ol_view(
viewid
, viewname
, center
, extent
, maxresolution
, minresolution
, maxzoom
, minzoom
, zoom
, projection
, resolution
, resolutions
, rotation
, description
)
VALUES(
#{viewId}
, #{viewName}
, #{center, javaType=ObjectArray}
, #{extent, javaType=ObjectArray}
, #{maxResolution}
, #{minResolution}
, #{maxZoom}
, #{minZoom}
, #{zoom}
, #{projection}
, #{resolution}
, #{resolutions, javaType=ObjectArray}
, #{rotation}
, #{description});
</insert>
</mapper>