第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機(jī)立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

無法使用 tomcat 獲得 CRS:

無法使用 tomcat 獲得 CRS:

慕勒3428872 2021-07-02 14:01:08
我有一個奇怪的情況。我使用 geotools 來投影柵格,例如它的工作原理CoordinateReferenceSystem targetCRS = CRS.decode("EPSG:3857");GridCoverage2D projectedImage = (GridCoverage2D) Operations.DEFAULT.resample(gridCoverageImage,                        targetCRS);現(xiàn)在我使用完全相同的代碼將我的進(jìn)程移到了 Web 服務(wù)器控制器中:public ResponseEntity<InputStreamResource> getProjectedImage(@RequestParam String filename, @RequestParam String targetCrs){     File file = new File(filename);     CoordinateReferenceSystem targetCRS = CRS.decode(targetCrs);     /** Some process to return file /**}我有:org.opengis.referencing.NoSuchAuthorityCodeException: No code "EPSG:3857"from authority "EPSG" found for object of type "EngineeringCRS"我的 pom.xml   <dependency>        <groupId>org.geotools</groupId>        <artifactId>gt-shapefile</artifactId>        <version>18.2</version>    </dependency>    <dependency>        <groupId>org.geotools</groupId>        <artifactId>gt-epsg-hsql</artifactId>        <version>18.2</version>    </dependency>       <dependency>        <groupId>org.geotools</groupId>        <artifactId>gt-coverage</artifactId>        <version>18.2</version>    </dependency>         <dependency>        <groupId>org.geotools</groupId>        <artifactId>gt-geotiff</artifactId>        <version>18.2</version>    </dependency>       <dependency>        <groupId>org.geotools</groupId>        <artifactId>gt-image</artifactId>        <version>18.2</version>    </dependency>    <dependency>        <groupId>org.geotools</groupId>        <artifactId>gt-wms</artifactId>        <version>18.2</version>    </dependency> 當(dāng)我查看 WEB-INF/lib 時,所有 jar 都在這里,包括依賴項(gt-reference、gt-metadata .....)Tomcat:8.0 Java 8 地理工具:18.2當(dāng)我不在 servlet 容器中時它工作正常。此外,來自 geotools 的其他實(shí)用程序運(yùn)行良好。例如,裁剪或 GridCoverage2D 轉(zhuǎn)換在這個 servlet 容器中工作。你能幫我理解發(fā)生了什么嗎?
查看完整描述

2 回答

?
波斯汪

TA貢獻(xiàn)1811條經(jīng)驗(yàn) 獲得超4個贊

您的問題很可能是 Tomcat(或運(yùn)行它的用戶)沒有寫入權(quán)限,java.io.tmpdir這是 GeoTools 在第一次查找 EPSG 代碼時將 H2 EPSG 數(shù)據(jù)庫解壓到的地方。

您可以更改臨時目錄的權(quán)限以允許 tomcat 在那里寫入,或者您可以通過更改或 中的CATALINA_TMPDIR變量來更改它使用的位置,或者簡單地添加到您的啟動腳本中。catalina.shcatalina.batDjava.io.tmpdir=c:\{yourDir}

這個問題也有一些可能有幫助的答案。


查看完整回答
反對 回復(fù) 2021-07-07
?
開心每一天1111

TA貢獻(xiàn)1836條經(jīng)驗(yàn) 獲得超13個贊

我找到了一個解決方法,即使它不能解決最初的問題(與 geotools 的依賴關(guān)系和部署到 Tomcat 中有關(guān))


不要使用 gt-epsg-hsql,這會導(dǎo)致您的應(yīng)用搜索 EPSG 代碼以解碼到 HSQL 數(shù)據(jù)庫中。


而不是CRS.decode(targetCrs); 與


CRS.parseWKT("PROJCS[\"WGS 84 / Plate Carree (deprecated)\",\r\n" + 

                "    GEOGCS[\"WGS 84\",\r\n" + 

                "        DATUM[\"WGS_1984\",\r\n" + 

                "            SPHEROID[\"WGS 84\",6378137,298.257223563,\r\n" + 

                "                AUTHORITY[\"EPSG\",\"7030\"]],\r\n" + 

                "            AUTHORITY[\"EPSG\",\"6326\"]],\r\n" + 

                "        PRIMEM[\"Greenwich\",0,\r\n" + 

                "            AUTHORITY[\"EPSG\",\"8901\"]],\r\n" + 

                "        UNIT[\"degree\",0.0174532925199433,\r\n" + 

                "            AUTHORITY[\"EPSG\",\"9122\"]],\r\n" + 

                "        AUTHORITY[\"EPSG\",\"4326\"]],\r\n" + 

                "    PROJECTION[\"Equirectangular\"],\r\n" + 

                "    UNIT[\"metre\",1,\r\n" + 

                "        AUTHORITY[\"EPSG\",\"9001\"]],\r\n" + 

                "    AXIS[\"X\",EAST],\r\n" + 

                "    AXIS[\"Y\",NORTH],\r\n" + 

                "    AUTHORITY[\"EPSG\",\"32662\"]]");

您可以在此處找到與每個 EPSG 代碼相關(guān)的所有 WKT


如果有人對原始問題有答案或解釋,我很樂意閱讀它:)


查看完整回答
反對 回復(fù) 2021-07-07
  • 2 回答
  • 0 關(guān)注
  • 533 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號