Skip to main content
Question

Merge Polygons

  • December 16, 2014
  • 6 replies
  • 17 views

Hi,

 

 

I have list of IDs (of polygons) in csv and I would like to extract those polygons from Oracle Spatial.Number of polygons may run in tens of thousands. After extracting would like to aggregate them and put it back in database or create a shape file.

 

 

What's tha best and efficient way to do it.

 

 

Cheers,

 

John

6 replies

david_r
Evangelist
  • December 16, 2014
Hi,

 

 

one way would be to read the list of IDs using the CSV reader, then send each ID to a FeatureReader to extract the polygons from Oracle. After processing, either write them back to Oracle using a writer in Update-mode, or write it out to a shape file.

 

 

David

fmelizard
Contributor
Forum|alt.badge.img+17
  • Contributor
  • December 16, 2014
Hallo,

 

 

Another option would be to aggregate the ID's and use it in the FeatureReader or SQLExecutor using a IN syntax in your where clause.

 

Itay

gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • December 16, 2014
...each ID to the reader??? Is'nt that a tad slow?

 

....Aggregate maybe (tens of) thousands of id's into a string..

 

 

Might as well use inlinequerier then.

 

 

When you have (tens of) thousand of polygons and maybe thaousands of ID's i think it is wise to create an external reference tabel.

 

 

 

I think its more efficient use ODBC

 

Save it to a Excel and make a datalink to it.

 

(connect to Excel and Access by using Oracle Heterogeneous Service...which has been available since Oracle 8i.)

 

 

https://docs.oracle.com/cd/E11882_01/owb.112/e10582/loading_ms_data.htm

 

 

 

 

fmelizard
Contributor
Forum|alt.badge.img+17
  • Contributor
  • December 16, 2014
hitting the db for each feature is less efficient than aggregating it, but it all depends on the db settings.

 

Then again you can just do it all in Oracle, no need to extract the data and write it back.

 

 

gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • December 17, 2014
I would have to test to see if linking to a excel in a Oracle SQL is not faster then having to do an 'In" on a string with (ten)thousands of elements.... try it out.

fmelizard
Contributor
Forum|alt.badge.img+17
  • Contributor
  • December 18, 2014
the IN clause has a limitation of a 1000 features, but you overcome this by building it in your workspace.

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings