简体   繁体   中英

Is there a general way to load/store spatial data from/to different kinds of databases?

I have a requirement that I need help.

My application is for loading and storing data from different databases, which is some kind of data integration. The databases could be Oracle, MySQL, SQL Server. One possible data type to be considered is spatial data type. As we know, different type of database has defined their own spatial data type. What I want to do, for example, is to load one spatial data from SQL Server, and save this spatial data to Oracle database.

I am using Java. And I only find hibernate spatial seems be able to do similar thing. My questions are:

  1. Is there any existing library that can help me do what above?
  2. Anyone has such experience to share?

Thanks very much.

As Spacedman says, if the data source is a JSON in a WKT format , you can save it with hibernate-spatial . No matter the database where it comes from.

https://drive.google.com/file/d/0B7k8rmEmSGVdVU0weGk4dFV5UFE/view

A quick google of "Oracle spatial wkt", "sql server spatial wkt" and "mysql spatial wkt" seems to show that they all support - you guessed it - WKT!

This is the Well Known Text format for spatial data, and is an OGC standard. The three DBMSs you mention all seem to have functions to store their spatial data types from WKT strings. You should be able to get the spatial data out as WKT from one database and save it to another.

Note you forgot the one DBMS you really should be using - PostGIS...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM