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

 

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

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


(資料圖片)

postgis依賴

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

創(chuàng)建連接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連接參數(shù)

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

連接池參數(shù)

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有多個子類,實現(xiàn)了許多類型的過濾器,包括簡單的屬性比較和空間查詢。

// 普通字段FilterFactory ff = CommonFactoryFinder.getFilterFactory();/** * field 字段名 * value 條件值 * geometry 條件幾何體 *  *  * matchCase 是否區(qū)分大小寫,默認true-區(qū)分 * MatchAction(實現(xiàn)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集合的邏輯關(guān)系,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的實現(xiàn)類具體實現(xiàn)函數(shù),name-函數(shù)名,例如: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 最大條數(shù) * 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);//計數(shù)// 分頁,倒序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必須關(guān)閉,否則會造成內(nèi)存泄漏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 修改字段名數(shù)組* values 修改值數(shù)組* fliter 過濾條件* names和values順序保持一致*/ContentFeatureSource featureSource = (ContentFeatureSource) jdbcDataStore.getFeatureSource(tableName);SimpleFeatureStore store = (SimpleFeatureStore)featureSource;  // write access!store.modifyFeature(names, values, filter)

關(guān)鍵詞:

 

關(guān)于我們 - 聯(lián)系我們 - 版權(quán)聲明 - 招聘信息 - 友鏈交換

2014-2020  電腦商網(wǎng) 版權(quán)所有. All Rights Reserved.

備案號:京ICP備2022022245號-1 未經(jīng)過本站允許,請勿將本站內(nèi)容傳播或復制.

聯(lián)系我們:435 226 40@qq.com

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

            欧美二区三区的天堂| 中文字幕综合网| 亚洲一二三级电影| 国产成人小视频| 日韩理论片网站| 欧美一区二区视频在线观看2020 | 亚洲国产成人私人影院tom| 色诱视频网站一区| 久久精品亚洲国产奇米99| 午夜国产精品影院在线观看| 成人免费毛片片v| 亚洲一区电影777| 久久久久综合网| 日本伊人精品一区二区三区观看方式| 99精品一区二区三区| 亚洲电影激情视频网站| 亚洲精品一区二区三区精华液| 丝袜诱惑制服诱惑色一区在线观看| heyzo一本久久综合| 亚洲电影一区二区| 中文字幕av资源一区| 激情久久五月天| 亚洲欧美电影院| 久久综合丝袜日本网| 日韩av不卡在线观看| 久久综合国产精品| 日本精品免费观看高清观看| 国产精品无人区| 国产美女娇喘av呻吟久久| 亚洲猫色日本管| 久久精品欧美一区二区三区不卡| 久久av中文字幕片| 亚洲免费观看高清完整版在线观看熊 | 亚洲电影在线免费观看| 91在线免费视频观看| 欧美性猛交xxxx黑人交| 亚洲精品一二三| 久久天堂av综合合色蜜桃网| 欧美日韩在线播放| 亚洲制服欧美中文字幕中文字幕| 91在线视频播放地址| 欧美绝品在线观看成人午夜影视| 亚洲综合小说图片| 久久久99精品免费观看| 在线不卡一区二区| 日本欧美一区二区在线观看| 国产精品理伦片| 精品国产乱码久久久久久图片| 麻豆国产精品777777在线| 亚洲欧美国产高清| 国产精品国产三级国产普通话99| 成人在线综合网| 欧美性大战xxxxx久久久| 亚洲韩国一区二区三区| 欧美激情资源网| 欧美成人一区二区三区| 黑人巨大精品欧美黑白配亚洲| 一区二区在线看| 亚洲欧洲av在线| www成人在线观看| 91精品国产aⅴ一区二区| 日本va欧美va精品发布| 樱桃视频在线观看一区| 中文字幕在线不卡| 久久久影视传媒| 精品久久久久久无| 国产91丝袜在线播放九色| 欧美日韩在线亚洲一区蜜芽| 日本成人中文字幕| 亚洲成国产人片在线观看| 一区二区三区在线播| 国产精品久久久久久久久免费桃花| 久久九九99视频| 91在线观看污| 精品国产三级a在线观看| 国产999精品久久| 9191精品国产综合久久久久久| 久久99精品国产.久久久久久| 五月激情丁香一区二区三区| 亚洲国产成人av好男人在线观看| 综合中文字幕亚洲| 亚洲码国产岛国毛片在线| 国产精品电影一区二区三区| 亚洲国产精品精华液2区45| 久久综合久久综合久久| 精品国产电影一区二区| 国产白丝精品91爽爽久久| 欧美丰满一区二区免费视频| 国产一区二区三区在线观看免费 | 成人免费小视频| 亚洲欧美自拍偷拍色图| 国产精品人成在线观看免费| 国产精品视频第一区| 国产视频一区二区在线观看| 国产性做久久久久久| 久久久综合视频| 国产精品午夜在线观看| 欧美国产日产图区| 亚洲人成人一区二区在线观看| 国产精品传媒入口麻豆| 亚洲欧美日韩一区| 一区二区三区欧美日| 亚洲18女电影在线观看| 亚洲成人激情av| 日韩电影在线观看网站| 91国偷自产一区二区使用方法| 欧美aaa在线| 欧美性极品少妇| 国产精品66部| 欧美岛国在线观看| 26uuu欧美| 成人免费一区二区三区在线观看| 中文字幕亚洲成人| 亚洲午夜电影在线| 日本精品一区二区三区四区的功能| 免费精品视频在线| 欧美精品久久久久久久久老牛影院| 国产成人一级电影| 欧美电视剧在线观看完整版| 国产亚洲一二三区| 亚洲男人天堂一区| 亚洲高清免费在线| 激情六月婷婷久久| 精品粉嫩超白一线天av| 国产日产亚洲精品系列| 一区二区三区在线免费播放 | 26uuuu精品一区二区| 欧美高清在线视频| 亚洲成在人线在线播放| 色噜噜狠狠成人中文综合| 国产精品资源在线看| 欧美精品一区视频| 国产精品久久福利| 日韩综合在线视频| 欧美日韩免费高清一区色橹橹| av在线一区二区三区| 国产精品久久久久婷婷二区次| 伊人色综合久久天天人手人婷| 青青青伊人色综合久久| 日韩写真欧美这视频| 国产视频在线观看一区二区三区| 亚洲一区在线观看免费观看电影高清 | 久久精品亚洲精品国产欧美kt∨| 曰韩精品一区二区| 欧美在线短视频| 99re热这里只有精品视频| 成人免费一区二区三区在线观看 | 国产精品视频免费看| 亚洲成av人片| 欧美一区二区三级| 国产精品久久午夜夜伦鲁鲁| 日韩av一级电影| 日韩精品一区二区三区中文精品| 国产精品乱人伦| 麻豆高清免费国产一区| 久久久久国产精品人| 亚洲精品自拍动漫在线| 久久99精品久久久久久动态图 | 久久久久久久免费视频了| 亚洲高清不卡在线| 日韩欧美一级二级三级| 国产精品久久久久婷婷| 久久精品久久久精品美女| 久久久久免费观看| 亚洲二区视频在线| av毛片久久久久**hd| 亚洲一区二区三区小说| 欧美一级夜夜爽| 亚洲色图另类专区| 国产精品自产自拍| 亚洲欧美乱综合| 在线不卡a资源高清| 国产精品二区一区二区aⅴ污介绍| 久久电影网站中文字幕| 国产精品视频麻豆| 欧美日韩在线播放| 国产精品灌醉下药二区| 激情图片小说一区| 成人欧美一区二区三区白人| 欧美日韩高清不卡| 中文字幕制服丝袜成人av| 国产一级精品在线| 亚洲免费在线观看| 欧美不卡在线视频| 亚洲成av人片一区二区三区| 91免费国产在线观看| 日韩电影网1区2区| 日本一区二区三区国色天香| 91黄色激情网站| 中文字幕一区日韩精品欧美| 国产乱一区二区| 亚洲一区二区四区蜜桃| 精品国产sm最大网站免费看| 午夜欧美在线一二页| 国产日韩欧美综合一区| 精品一区二区三区不卡 | 中文久久乱码一区二区| 欧美日韩国产电影| 亚洲男人的天堂在线aⅴ视频| 成人天堂资源www在线|