mapinfo java api,用于解析MapInfo TAB格式的Java API

I am working on parsing a MapInfo TAB Format file in Java. It consists of a set of four files viz .TAB, .ID, .MAP and .DAT. After searching on web I came across a parser provided by GeoTools at this repository:

https://github.com/geotools/geotools/blob/master/modules/library/main/src/main/java/org/geotools/data/MapInfoFileReader.java

When I use this API for parsing the MAPInfo TAB format file bundle, the API throws exception:

"Didn't find a minimum of three control points in the .tab file."

I am using public MapInfoFileReader(final File tabfile) constructor. I have tried using different versions of Geotools API.

Is there a work around for parsing MapInfo TAB Format file in Java? Or if anyone can provide sample code for using GeoTools' MapInfoFileReader

解决方案

There is no direct way to parse .TAB using java code. First of all you need to convert .TAB into KML or other extension using Gdal1 or ogr2ogr using this command line tool

ogr2ogr -f "KML" "filepath/filename.kml" "filepath/filename.TAB"

After that you can parse .kml file using java code using DOM parser2 API available in java.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值