[postgis-users] "Linux" geocoder script ?

fork forkandwait at gmail.com
Sat Mar 26 10:39:34 PDT 2011

Paragon Corporation <lr <at> pcorp.us> writes:

> You might want to also look at the script in the legacy_import folder of
> tiger_2010.

> That was a script set up by Steve Frost for 2008 when he reworked the tiger
> geocoder to work with the new shp format.  We couldn't use that because the
> client we needed to get this to work for 
> Was a windows client and that script is Linux centric.

Yeah, I looked -- extremely interactive (yuck).  

(One pendantic note -- "sh" or "bash" are *Unix* centric, not linux -- they are
the standard on Freebsd, etc).

> So check out the function - loader_load_staged_data in tiger folder   and
> you'll see what I mean

I use  it -- I basically generated a script with the select statement and then
started to work it over.  I think the problem is that Tiger 10 has a very
different schema than the parent table in tiger_data.  Not sure yet....

> > The idea is that you just change a few parameters at the top and then run
> it for your state.  It would be *far* easier to write code to SQL to
> generate a bunch of "X=Y\n" lines than what it does now.
> I like the idea of putting more parameters at the top, the reason we didn't
> and stored many of  the parameters in the table is because that is where the
> Linux/Windows/Unix code breaks apart and is different

I think the loader function can hide some of that. Also, there is no way to mix
batch and sh scripts, you might as well keep them totally separate...

> and our objective was
> to strive to create
> Something that could be used on all platforms (not just Linux).  Honestly
> that was our frustration with prior loader scripts is that most of our
> clients were on windows and needed it to work on windows and it didn't so
> they didn't use the geocoder.

I am glad those scripts work too.  The Unix / sh scripts though arent anywhere
near production ready.  Anywhere you see something like "%VAR%", that is a batch
file syntax that will throw an error in sh.  So, create_gecoder.sh just breaks
(I have a patch I will send later).
>   The only piece that is 
> truly cross platform is plpgsql (and also partly shp2pgsql) so that is why
> most of the variable specific stuff is kept in the tables 
> loader_platform, loader_variables
> so that we could as much as possible abstract away the non-crossplatform
> commandline and not require people to install perl or any other additional
> items

In the unix world you can assume that a Posix "sh" is installed -- it's like the
.bat file of Dos/Windows -- you cant even boot without it.  That's what my
script is written it.

> Thanks,
> Regina
> http://www.postgis.us

No, thank you for getting it this far! I would just like to be able to use it on
my favorite operating system too ;)

More information about the postgis-users mailing list