[postgis] Arcview script

Hisaji ONO ono96 at fa2.so-net.ne.jp
Tue Oct 2 05:34:03 PDT 2001


Hello.

 Thank you very much, Mr. Ross..

Your avenue script has helped me, because shp2pgsql sometimes couldn't
succeed to convert some large size polygon or line shapefiles.

 This scripts works fine, but it seemed not to support multipolygons even
these exist in the choice menu in your script.

 I 've changed the following part in your script to support multipolygons.


for each rec in theftab
  shp = thefTab.ReturnValue(thefTab.FindField("Shape"), rec).aspolygon
  partlist = shp.aspolygon.aslist

  'shpstr = x.setformat("dddddddd").asstring + 9.aschar + thefeat+"((("

  shpstr = x.setformat("dddddddd").asstring + 9.aschar + thefeat+"((" '<---
modified

  for each part in partlist
    ii = 0                      '<--- added
    shpstr = shpstr + "("'<--- added
    'for each p in part
    for each i in 0..(part.count - 2) '<--- modified

      p = part.get(i) '<--- modified
      shpstr = shpstr + p.getX.setformat("d.dddddd").asstring + " " +
p.getY.setformat("d.dddddd").asstring +", "

    end

     p = part.get(part.count - 1) '<--- added
     shpstr = shpstr + p.getX.setformat("d.dddddd").asstring + " " +
p.getY.setformat("d.dddddd").asstring + ")" '<--- added


    ii = ii + 1 '<--- added
    if (ii < partlist.count) then '<--- added
      shpstr = shpstr + "," '<--- added
    end '<--- added

  end

  'polystr = shpstr.left(shpstr.count - 2) + ")))" + 9.aschar
  polystr = shpstr.left(shpstr.count) + "))" + 9.aschar   '<--- modified


 Please tell me if you have any comment about this.

> Hi,
>
> We recently had some problematic shapefiles which shp2psql wouldn't
> process due to some topology problems in the shapefile. We couldn't
> track them down so I ended up writing an avenue script to produce a dump
> text file from a shapefile. It is rough and ready but does the job.
> shp2psql is much quicker but I thought I'd make it available in case
> anyone had a use for it.
>
> Ross
>



------------------------ Yahoo! Groups Sponsor ---------------------~-->
Get your FREE VeriSign guide to security solutions for your web site: encrypting transactions, securing intranets, and more!
http://us.click.yahoo.com/UnN2wB/m5_CAA/yigFAA/PhFolB/TM
---------------------------------------------------------------------~->

To unsubscribe from this group, send an email to:
postgis-unsubscribe at yahoogroups.com

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 





More information about the postgis-users mailing list