| | |
| | | package com.se.simu.service; |
| | | |
| | | import cn.hutool.db.handler.RsHandler; |
| | | import cn.hutool.json.JSONObject; |
| | | import com.se.simu.config.PropertiesConfig; |
| | | import com.se.simu.domain.dto.GeDb; |
| | | import com.se.simu.domain.vo.QueryVo; |
| | | import com.se.simu.helper.*; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.codec.binary.Base64; |
| | | import org.gdal.ogr.Geometry; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.client.RestTemplate; |
| | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.net.URLEncoder; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | |
| | | map.put("where", where); |
| | | } |
| | | if (!StringHelper.isEmpty(vo.getGeometry())) { |
| | | map.put("geometry", vo.getGeometry()); |
| | | Geometry g = Geometry.CreateFromWkt(vo.getGeometry()); |
| | | if (null != vo.getBuffer()) { |
| | | // 别问这个数怎么来的,凭本事猜的 |
| | | g = g.Buffer(vo.getBuffer() * 0.00000899928); |
| | | } |
| | | |
| | | map.put("geometry", g.ExportToWkt()); |
| | | map.put("inSR", 4326); |
| | | } |
| | | |
| | | String rs = restTemplate.postForObject(url, map, String.class); |