On Sat, Nov 29, 2008 at 12:24 PM, Justin Bronn <[EMAIL PROTECTED]> wrote:

>
> > I do have a few basic questions
> > - on slide 37, there's a Zipcode model, how does one populate this model?
> > Are we using fe_2007_us_zcta500.shp? If so, is there a program which
> > converts the zipcode shape from the shape file?
>
> Yes, you use that shapefile.  The script that loads the data is also
> in the presentation, go to slide 68 (in the `LayerMapping` section).
>

Thanks Justin, I was using MySQL and it looks like I do need Postgres to get
the best gis support.
Do people normally switch their DB backend entirely or do they start a new
project for geo stuff and connect the main site to this as a separate
backend? I can see the pros and cons of each approach. Just want to hear
about people's experience

I followed the example and did:
def test_zipcode():
    zipcode_mapping = { 'code' : 'ZCTA5CE00',
                        'mpoly' : 'MULTIPOLYGON',
                        }
    zipcode_shp = '/usr/local/share/census/fe_2007_us_zcta500.shp'

    lm = LayerMapping(Zipcode, zipcode_shp, zipcode_mapping)
    lm.save(verbose=True)

and tried a few zipcode in Admin interface. I see several problems and want
to make sure it's a data error rather than installation error:

1. There's no 08544 zipcode after the layer mapping. 08544 should point to
Princeton NJ.
2. I do see 08540 and 08542. 08542 seems correct but 08540 shows North
Pole??
3. I also did a shp2pgsql dump with srid=4269 which seems the closest match
of the prj file as compared to spatial_ref_sys in the pgsql db.
 shp2pgsql -s 4269 fe_2007_us_zcta500 zipcode > zipcode.sql
and 08544 is not there.

If so, it does look like the zipcode is incomplete even though the dataset
is fairly recent and from census. Do you have recommendation on what maybe a
better DataSource?


>
> > - on slide 41, there is an Address model, does GeoDjango provide
> geocoding
> > which converts it to (lat, lon) for spatial query? If not, does it mean
> that
> > one has to query Google/Yahoo/MSFT WebServices?
>
> No, GeoDjango does not provide geocoding services.  Geopy [1] is a
> popular Python geocoding interface.
>

Let say I want to do something similar to your example of HoustonCrimeMap,
and I use Geopy to perform the geocoding to get back the (lat, lon) for each
crime event location and I also want to show the events within a certain
radius R from a point P. Do you store the lat lon as a Point for each event
and construct a polygon of a circle(P,R) and check if the event point is
contained inside the polygon?

What do you recommend as the best practice?

Thanks

-Aaron



>
> Regards,
> -Justin
>
> [1] http://code.google.com/p/geopy/
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to