国产中文字幕在线播放_久久久久99精品国产片_66久久国产_国产精品自在在线_亚洲成av人片_国产一级黄色电影_伊人在线视频_欧美黄视频在线观看

 

當(dāng)前熱訊:Geotools基本增刪改查Feature

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


(資料圖片)

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.

過(guò)濾器-Filter

使用過(guò)濾器來(lái)定義要對(duì)其進(jìn)行操作的Feature集合。過(guò)濾器也可以組合成一個(gè)操作集合使用。簡(jiǎn)單說(shuō),過(guò)濾器相當(dāng)于SQL語(yǔ)句的WHERE子句中存在的信息。Filter有多個(gè)子類,實(shí)現(xiàn)了許多類型的過(guò)濾器,包括簡(jiǎn)單的屬性比較和空間查詢。

// 普通字段FilterFactory ff = CommonFactoryFinder.getFilterFactory();/** * field 字段名 * value 條件值 * geometry 條件幾何體 *  *  * matchCase 是否區(qū)分大小寫(xiě),默認(rèn)true-區(qū)分 * MatchAction(實(shí)現(xiàn)MultiValuedFilter的會(huì)有),匹配邏輯 * MatchAction.ANY-任何一個(gè)滿足,默認(rèn)值 * MatchAction.ALL-全部滿足 * MatchAction.ONE-只有一個(gè)滿足 * */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));//在時(shí)間期間Before before = ff.before(ff.property(field), ff.literal(value));//在時(shí)間之前After after = ff.after(ff.property(field), ff.literal(value));//在時(shí)間之后// 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的實(shí)現(xiàn)類具體實(shí)現(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 過(guò)濾器 * 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);//計(jì)數(shù)// 分頁(yè),倒序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)閉,否則會(huì)造成內(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 過(guò)濾條件**/ContentFeatureSource featureSource = (ContentFeatureSource) jdbcDataStore.getFeatureSource(tableName);SimpleFeatureStore store = (SimpleFeatureStore)featureSource;  // write access!store.removeFeatures(filter);

修改

/*** * typeName 圖層名* names 修改字段名數(shù)組* values 修改值數(shù)組* fliter 過(guò)濾條件* 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.

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

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

老司机亚洲精品| 亚洲国产日日夜夜| 国产视频一区不卡| 亚洲视频在线一区| 欧美高清性hdvideosex| 午夜电影网亚洲视频| 一区二区高清视频在线观看| 中文字幕av一区二区三区| 成人午夜精品一区二区三区| 亚欧洲精品视频在线观看| 色婷婷综合久久久久久| 精品一区二区三区视频在线播放| 99久久99热这里只有精品| www.日韩在线| 日韩国产一区三区| 草美女在线观看| 99精品国产在热久久| 精品欧美午夜寂寞影院| 久热精品在线| 成人黄色a**站在线观看| 欧美激情一区在线观看| 成人综合婷婷国产精品久久免费| 久久久综合九色合综国产精品| 欧美高清在线视频| 欧美性色综合网| 精品性高朝久久久久久久| 欧美一区二区在线视频| 色综合天天综合给合国产| 亚洲国产欧美精品| 在线亚洲人成| 91免费精品| 一区二区三区视频免费观看| 欧美深夜福利| 另类的小说在线视频另类成人小视频在线 | 91精品国产综合久久精品| 亚洲男人天堂2019| 亚洲日韩中文字幕| 一级毛片在线视频| av基地在线| 手机av免费在线| 久久综合另类图片小说| 日韩黄色一级片| 色婷婷久久久亚洲一区二区三区| 99视频入口| 日韩欧美在线番号| 天堂а在线中文在线无限看推荐| 97福利电影| 影音先锋电影在线观看| 欧美日韩高清在线| 国产一级粉嫩xxxx| 亚洲成人网av| 精品福利在线导航| 亚洲欧美在线免费| 日本二区视频| 伊人精彩视频| 青青草观看免费视频在线| 91热爆在线观看| 最猛黑人系列在线播放| 在线观看的av网站| 亚洲第一区视频| 麻豆传媒在线完整视频| av在线麻豆| 日韩中文视频| 日韩免费精品| 精品视频一二| 天天躁日日躁狠狠躁欧美| 极品美女一区二区三区| 亚洲乱码免费伦视频| 亚洲福利精品| 久久精品72免费观看| av资源网一区| 欧美极品aⅴ影院| 欧美日韩精品一区视频| 大荫蒂欧美视频另类xxxx| 亚洲视频一区二区在线| 日韩一区二区精品葵司在线| 最新天堂资源在线资源| 欧美三级精品| 999精品在线| 国产一区欧美一区| 亚洲精品黄网在线观看| 亚洲а∨精品天堂在线| 暖暖在线中文免费日本| 成人在线超碰| 最新亚洲激情| 国产精品无圣光一区二区| 欧美性一区二区| 色婷婷综合缴情免费观看| 日本美女久久| 亚洲作爱视频| 亚洲国产精品久久人人爱| 成r视频免费观看在线播放| 亚洲va中文在线播放免费| 久久福利影视| 亚洲综合色成人| 青青草手机在线| 亚洲激情播播| 国产亚洲综合色| a视频免费看| 欧美高清免费| 国产精品69毛片高清亚洲| 精品亚洲夜色av98在线观看| 蜜桃视频在线观看www社区| 欧美日中文字幕| 最新中文字幕一区二区三区| 超碰在线公开超碰在线| 大奶在线精品| caoporn国产精品| 亚洲电影在线观看| 2019中文字幕在线电影免费| 亚洲精品888| 国产精品网站在线| 91精品久久久久久久99蜜桃| 色猫av在线| 亚洲超碰在线观看| 久久99久久99精品免视看婷婷| 亚洲欧美偷拍卡通变态| 亚洲片在线观看| 嫩草伊人久久精品少妇av杨幂| 亚洲午夜极品| 亚洲国产精品嫩草影院| 免费黄色片在线观看| 台湾亚洲精品一区二区tv| 国产成人鲁色资源国产91色综| 欧美精选一区二区| hd国产人妖ts另类视频| 欧美午夜不卡影院在线观看完整版免费| 国产欧美日韩精品在线| 高清hd写真福利在线播放| 999色成人| 国产白丝精品91爽爽久久| 日韩欧美不卡一区| 欧美free嫩15| 国产一区二区三区四区五区入口 | 精品淫伦v久久水蜜桃| 成人高清在线视频| 亚洲精品网站在线播放gif| 亚洲最大的免费视频网站| 国产精品一区一区| 精品在线观看国产| 国产成人高清精品免费5388| 99国产精品久久久久久久久久久 | 国产精品久久久久无码av| 一区二区三区中文字幕电影| 你懂的视频在线| 久久精品av| 91久久精品日日躁夜夜躁欧美| 日韩免费影院| 国产东北露脸精品视频| 日本中文字幕电影在线免费观看| 欧洲精品一区| 亚洲精品福利视频网站| 天堂аⅴ在线地址8| 国产精品99久久| 亚洲图片欧美激情| 黄网在线免费| 国产欧美日韩影院| 久久久99精品免费观看不卡| 亚洲精品男人| 欧美国产精品| 欧美日韩在线看| 欧美18一19xxx性| 国产成人午夜高潮毛片| h片在线观看网站| 亚洲男帅同性gay1069| 窝窝社区一区二区| 另类图片激情| 91女厕偷拍女厕偷拍高清| 国产午夜精品一区在线观看| 欧美综合视频在线观看| 欧美天堂一区| 国产a久久麻豆| 亚洲第一福利网| vam成人资源在线观看| 美女爽到高潮91| 91精选在线观看| 日韩欧美天堂| 欧美视频在线不卡| 国产一区二区三区亚洲综合| 久久精品视频免费| 精品呦交小u女在线| 国产suv精品一区二区四区视频| 国产精品久久久久影视| 日本高清成人vr专区| 欧美国产日韩精品免费观看| 婷婷久久免费视频| 一区二区在线看| 精品国产鲁一鲁****| 国产精品久久久久天堂| 成人在线网址| 久久久综合激的五月天| 91九色在线播放| 亚洲人成电影网站色mp4| 日本在线观看高清完整版| 欧美午夜片欧美片在线观看| 国产ts一区| 亚洲片av在线| 高清在线不卡av| 女同一区二区免费aⅴ| 亚洲国产一二三|