日韩亚洲国产高清免费视频_国产精品2020观看久久_久久99精品福利久久久_我要看欧美精品一级毛片

 

當前熱訊:Geotools基本增刪改查Feature

發布時間:2023-04-24 05:27:35  |  來源:博客園  


(資料圖片)

postgis依賴

    org.geotools    gt-main    27.2    org.geotools    gt-jdbc-postgis    27.2

創建連接JDBCDataStore

Map params = Map.of(    PostgisNGDataStoreFactory.HOST.key, host,    PostgisNGDataStoreFactory.PORT.key, port,    PostgisNGDataStoreFactory.DATABASE.key, database,    PostgisNGDataStoreFactory.SCHEMA.key, schema,    PostgisNGDataStoreFactory.USER.key, user,    PostgisNGDataStoreFactory.PASSWD.key, passwd,    PostgisNGDataStoreFactory.DBTYPE.key, dbtype);JDBCDataStore jdbcDataStore = (JDBCDataStore)DataStoreFinder.getDataStore(params);

JDBCDataStore連接參數

ParameterDescription
dbtypeMust be the string postgis
hostMachine name or IP address to connect to
portPort number to connect to, default 5432
schemaThe database schema to access
databaseThe database to connect to
userUser name
passwdPassword
loose bboxFlag controlling loose bbox comparisons, default is true
preparedStatementsFlag controlling whether prepared statements are used, default is false
encode functionsFlag controlling if some common functions can be encoded into their SQL equivalent

連接池參數

ParameterDescription
max connectionsMaximum number of connection the pool will hold at any time, default is 10
min connectionsMinimum number of connection the pool will hold at any time, default is 1
connection timeoutMaximum number of second the pool will wait when trying to obtain a connection, default is 20 seconds
validate connectionsFlag controlling if the pool should validate connections when a new connection is obtained
Max open prepared statementsMaximum number of prepared statements kept open and cached for each connection in the pool. Set to 0 to have unbounded caching, -1 to disable
Test while idlePeriodically test if the connections are still valid also while idle in the pool
Time between evictor runsNumber of seconds between idle object evictor runs. The default value is 300 seconds.
Min evictable timeNumber of seconds a connection needs to stay idle before the evictor starts to consider closing it
Evictor tests per runNumber of connections checked by the idle connection evictor for each of its runs. The default value is 3 connections.

過濾器-Filter

使用過濾器來定義要對其進行操作的Feature集合。過濾器也可以組合成一個操作集合使用。簡單說,過濾器相當于SQL語句的WHERE子句中存在的信息。Filter有多個子類,實現了許多類型的過濾器,包括簡單的屬性比較和空間查詢。

// 普通字段FilterFactory ff = CommonFactoryFinder.getFilterFactory();/** * field 字段名 * value 條件值 * geometry 條件幾何體 *  *  * matchCase 是否區分大小寫,默認true-區分 * MatchAction(實現MultiValuedFilter的會有),匹配邏輯 * MatchAction.ANY-任何一個滿足,默認值 * MatchAction.ALL-全部滿足 * MatchAction.ONE-只有一個滿足 * */PropertyIsEqualTo equal = ff.equal(ff.property(field), ff.literal(value), true);//等于PropertyIsLike like = ff.like(ff.property(field), "%keywords%");//模糊匹配PropertyIsNotEqualTo notEqualTo = ff.notEqual(ff.property(field), ff.literal(value));//不等于PropertyIsNull aNull = ff.isNull(ff.property(field));//nullPropertyIsGreaterThan greater = ff.greater(ff.property(field), ff.literal(value));// 大于PropertyIsGreaterThanOrEqualTo greaterOrEqual = ff.greaterOrEqual(ff.property(field), ff.literal(value));// 大于等于PropertyIsLessThan less = ff.less(ff.property(field), ff.literal(value));//小于PropertyIsLessThanOrEqualTo lessOrEqual = ff.lessOrEqual(ff.property(field), ff.literal(value));//小于等于PropertyIsBetween between = ff.between(ff.property(field), ff.literal(value), ff.literal(value));//在...之間During during = ff.during(ff.property(field), ff.literal(value));//在時間期間Before before = ff.before(ff.property(field), ff.literal(value));//在時間之前After after = ff.after(ff.property(field), ff.literal(value));//在時間之后// Geometry字段FilterFactory2 ff2 = CommonFactoryFinder.getFilterFactory2();Beyond beyond = ff2.beyond(ff2.property(featureSource.schema.geometryDescriptor.localName), ff2.literal(geometry), 100.0, Units.METRE.name);// 圖層幾何字段超出給定幾何100米距離的Contains contains = ff2.contains(ff2.property(featureSource.schema.geometryDescriptor.localName), ff2.literal(geometry));// 圖層幾何字段包含給定幾何Within within = ff2.within(ff2.property(featureSource.schema.geometryDescriptor.localName), ff2.literal(geometry));// 圖層幾何字段被給定幾何包含Intersects intersects = ff2.intersects(ff2.property(featureSource.schema.geometryDescriptor.localName), ff2.literal(geometry));// 圖層幾何字段與給定幾何相交Disjoint disjoint = ff2.disjoint(ff2.property(featureSource.schema.geometryDescriptor.localName), ff2.literal(geometry));// 圖層幾何字段與給定幾何不相交Touches touches = ff2.touches(ff2.property(featureSource.schema.geometryDescriptor.localName), ff2.literal(geometry));// 圖層幾何字段與給定幾何相切// filter集合的邏輯關系,and并,or或,not非And and = ff.and(List.of(equal,like,beyond));//Or or = ff.or(List.of(notEqualTo,greater,contains));Not not = ff.not(during);// Function的實現類具體實現函數,name-函數名,例如:min,strReplace,toWKTFunction function = ff.function(name,expr1,exprN);PropertyName property = ff.property(field);Literal v = ff.literal(value);Function min = ff.function("min", property, v);PropertyName property = ff.property(field);Literal search = ff.literal("search");Literal replace = ff.literal("replace");Literal all = ff.literal( true );Function replace = ff.function("strReplace", new Expression[]{property,search,replace,all});PropertyName property = ff.property(featureSource.schema.geometryDescriptor.localName);Function toWKT = ff.function("toWKT", property);

查詢

/** * tableName 表名 * filter 過濾器 * List propNames 字段名列表 *  * startIndex 起始位 * maxFeatures 最大條數 * sortField 排序字段名 * */ContentFeatureSource featureSource = (ContentFeatureSource) jdbcDataStore.getFeatureSource(tableName);//返回字段列List propertyNames = propNames.stream().map(ff::property).collect(Collectors.toList());Query query = new Query(tableName,filter,propertyNames);int count = featureSource.getCount(query);//計數// 分頁,倒序query.setStartIndex(startIndex);query.setMaxFeatures(maxFeatures);query.setSortBy(new SortByImpl(ff.property(sortField), SortOrder.DESCENDING));ContentFeatureCollection collection = featureSource.getFeatures(query);SimpleFeatureIterator iterator = collection.features();// SimpleFeatureIterator必須關閉,否則會造成內存泄漏iterator.close();

新增

/*** tableName 圖層名* fieldName1 字段名* fieldValue1 字段值**/ContentFeatureSource featureSource = (ContentFeatureSource) jdbcDataStore.getFeatureSource(tableName);SimpleFeatureStore store = (SimpleFeatureStore)featureSource;  // write access!SimpleFeatureBuilder featureBuilder = new SimpleFeatureBuilder(store.getSchema());featureBuilder.set(fieldName1,fieldValue1);featureBuilder.set(fieldNameN,fieldValueN);SimpleFeature feature = featureBuilder.buildFeature(null);ListFeatureCollection featureCollection = new ListFeatureCollection(store.getSchema(), List.of(feature));List addFeatures = store.addFeatures(featureCollection);

刪除

/**** typeName 圖層名* fliter 過濾條件**/ContentFeatureSource featureSource = (ContentFeatureSource) jdbcDataStore.getFeatureSource(tableName);SimpleFeatureStore store = (SimpleFeatureStore)featureSource;  // write access!store.removeFeatures(filter);

修改

/*** * typeName 圖層名* names 修改字段名數組* values 修改值數組* fliter 過濾條件* names和values順序保持一致*/ContentFeatureSource featureSource = (ContentFeatureSource) jdbcDataStore.getFeatureSource(tableName);SimpleFeatureStore store = (SimpleFeatureStore)featureSource;  // write access!store.modifyFeature(names, values, filter)

關鍵詞:

 

關于我們 - 聯系我們 - 版權聲明 - 招聘信息 - 友鏈交換

2014-2020  電腦商網 版權所有. All Rights Reserved.

備案號:京ICP備2022022245號-1 未經過本站允許,請勿將本站內容傳播或復制.

聯系我們:435 226 40@qq.com

日韩亚洲国产高清免费视频_国产精品2020观看久久_久久99精品福利久久久_我要看欧美精品一级毛片

            国产精品午夜在线观看| 欧美精品v国产精品v日韩精品| 制服丝袜中文字幕亚洲| 国产精品色哟哟| 免费成人在线观看| 久久久久青草大香线综合精品| 亚洲国产一区二区三区| 欧美成人vps| 亚洲国产精品久久久男人的天堂| 国产美女娇喘av呻吟久久 | 91.麻豆视频| 亚洲欧美日韩一区二区三区在线观看| 久久成人av少妇免费| 国产欧美日韩综合精品一区二区| 91国偷自产一区二区三区成为亚洲经典| 久久久影视传媒| 日本视频在线一区| 亚洲国产精品成人综合色在线婷婷 | 欧美精品在线视频| 一区二区三区av电影| 97精品久久久久中文字幕 | 亚洲国产另类av| 久久久久亚洲蜜桃| 久久精品久久精品| 中文字幕一区二区三区不卡| 91精品国产aⅴ一区二区| 一区二区三区精品久久久| eeuss鲁片一区二区三区在线看| 亚洲一区二区3| 中文字幕欧美区| 国产精品一二三在| 亚洲自拍欧美精品| 国产三级久久久| 国产麻豆视频一区| 亚洲制服丝袜一区| 中文乱码免费一区二区| 国产精品一卡二| 香蕉久久一区二区不卡无毒影院 | 91精品国产91热久久久做人人| 亚洲一区二区三区视频在线播放| 久久综合av免费| 欧美男女性生活在线直播观看| 亚洲狠狠爱一区二区三区| 久久久欧美精品sm网站| 51精品秘密在线观看| 视频一区欧美精品| 国产精品蜜臀av| 久久久亚洲精华液精华液精华液| 国产综合色产在线精品| 一区二区高清视频在线观看| 中文一区二区完整视频在线观看| 成人激情小说网站| 欧美日韩激情一区| 日韩黄色一级片| 亚洲丝袜制服诱惑| 国产人妖乱国产精品人妖| 国产成人综合在线| 在线国产亚洲欧美| 亚洲成在人线在线播放| 中文字幕一区在线观看视频| 国产亚洲一区二区三区在线观看| 国产成人免费在线视频| 欧美在线免费观看视频| 午夜欧美一区二区三区在线播放| 国产精品国模大尺度视频| 久久久久97国产精华液好用吗| 国产成人鲁色资源国产91色综 | 在线看不卡av| 日韩中文字幕1| 亚洲一区二区在线免费看| 亚洲女同ⅹxx女同tv| 国产精品久久毛片| 中文字幕乱码日本亚洲一区二区| 91丝袜美女网| 欧美v日韩v国产v| 国产91精品入口| 51精品秘密在线观看| 国产毛片精品视频| 欧美疯狂做受xxxx富婆| 精品一区二区三区av| 色婷婷亚洲一区二区三区| 香蕉乱码成人久久天堂爱免费| 亚洲人成小说网站色在线| 日韩毛片高清在线播放| 中文字幕精品一区二区三区精品| 国产亚洲成年网址在线观看| 99精品视频中文字幕| 精品久久久久久亚洲综合网| 成人av在线一区二区三区| 日韩一区二区三区免费看 | 欧美在线一区二区| 久久不见久久见免费视频1| 91黄色免费看| 精品伊人久久久久7777人| 欧美日韩一区高清| 国产综合久久久久久久久久久久| 欧美日韩在线播| 国产精品影视网| 日韩三级av在线播放| 成人一区二区在线观看| 欧美成人艳星乳罩| 99久久国产免费看| 国产亚洲成aⅴ人片在线观看 | 午夜av电影一区| 色视频成人在线观看免| 另类中文字幕网| 欧美丰满嫩嫩电影| 福利视频网站一区二区三区| 精品日韩一区二区三区免费视频| 92国产精品观看| 欧美激情在线免费观看| 国产精品日韩成人| 一区二区三区精品久久久| 亚洲高清免费观看| 蜜臀av亚洲一区中文字幕| 欧美日韩一二区| 高清视频一区二区| 久久噜噜亚洲综合| 国产欧美精品区一区二区三区| 亚洲女同一区二区| 亚洲va韩国va欧美va精品| 麻豆91在线播放免费| 91精品国产高清一区二区三区蜜臀| 99久久精品免费| 国产精品不卡在线观看| 樱桃视频在线观看一区| 免费精品视频最新在线| 欧美一区在线视频| 久久久亚洲综合| 亚洲精品国产高清久久伦理二区| 亚洲成人自拍一区| 国产一区三区三区| 国产午夜亚洲精品午夜鲁丝片| 国产日韩欧美在线一区| 一区二区在线看| 在线看日韩精品电影| 成人精品免费看| 亚洲欧美影音先锋| 色综合色狠狠天天综合色| 国产裸体歌舞团一区二区| 久久精品在这里| 悠悠色在线精品| 国产一区二区福利视频| 久久久电影一区二区三区| 亚洲欧美日韩电影| 看片的网站亚洲| 久久精品一级爱片| 一区二区三区欧美日| 国内不卡的二区三区中文字幕| 久久蜜桃av一区精品变态类天堂| 中文字幕在线观看一区二区| 免费高清视频精品| 久久久亚洲精华液精华液精华液 | 欧美大片顶级少妇| 国产精品美日韩| 美女视频黄 久久| 2020国产精品自拍| 亚洲欧美日韩国产一区二区三区| 久久不见久久见免费视频7 | 久久av中文字幕片| 国产偷v国产偷v亚洲高清| 亚洲一区中文在线| 成人晚上爱看视频| 亚洲精品老司机| 在线不卡欧美精品一区二区三区| 国产精品天干天干在线综合| 青青国产91久久久久久 | 人人精品人人爱| 国产色综合一区| 色综合久久久久久久久久久| 99精品视频在线观看| 亚洲午夜一区二区| 日韩欧美综合在线| 亚洲精品你懂的| 国产91精品露脸国语对白| 亚洲乱码国产乱码精品精98午夜| 欧美性大战久久久久久久蜜臀| 久久精品这里都是精品| 奇米色777欧美一区二区| 国产偷国产偷亚洲高清人白洁| 色欧美日韩亚洲| 国产女主播在线一区二区| 久久超碰97中文字幕| 亚洲视频一二三区| 欧美精品xxxxbbbb| 亚洲美女视频在线观看| 懂色av一区二区三区蜜臀| 一区二区三区中文免费| 精品欧美黑人一区二区三区| 亚洲综合精品自拍| 久久一留热品黄| 久久精品久久综合| 亚洲精选视频免费看| 日韩欧美亚洲另类制服综合在线| 亚洲自拍偷拍图区| 国产亚洲精品aa| 国产精品亚洲一区二区三区妖精 | 欧美日韩在线一区二区| 综合婷婷亚洲小说| 波波电影院一区二区三区|