| | |
| | | import com.se.simu.domain.vo.QueryVo; |
| | | import com.se.simu.helper.*; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.gdal.ogr.Geometry; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.client.RestTemplate; |
| | |
| | | map.put("containCount", vo.getContainCount()); |
| | | map.put("count", vo.getCount()); |
| | | map.put("start", vo.getStart()); |
| | | map.put("querytype", vo.getQuerytype()); |
| | | map.put("querytype", "entity"); |
| | | if (!StringHelper.isEmpty(vo.getWhere())) { |
| | | String where = RsaHelper.encrypt(getPublicKey(), vo.getWhere()); |
| | | map.put("where", vo.getWhere()); |
| | | 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); |