Skip to content

Commit

Permalink
Using wkid's where possible
Browse files Browse the repository at this point in the history
  • Loading branch information
Michal Migurski committed Apr 2, 2011
1 parent fcaf282 commit 2cafaaf
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions TileStache/Vector.py
Expand Up @@ -254,7 +254,10 @@ def _reserialize_to_arc(content):

response = {'spatialReference': {'wkid': 4326}, 'features': []}

if 'wkt' in content['crs']:
if 'wkid' in content['crs']:
response['spatialReference'] = {'wkid': content['crs']['wkid']}

elif 'wkt' in content['crs']:
response['spatialReference'] = {'wkt': content['crs']['wkt']}

for feature in content['features']:
Expand Down Expand Up @@ -535,8 +538,11 @@ def renderTile(self, width, height, srs, coord):
sref = osr.SpatialReference()
sref.ImportFromProj4(self.layer.projection.srs)
response['crs'] = {'wkt': sref.ExportToWkt()}

if srs == getProjectionByName('spherical mercator').srs:
response['crs']['wkid'] = 102113
else:
response['crs'] = {'srid': 4326}
response['crs'] = {'srid': 4326, 'wkid': 4326}

return VectorResponse(response, self.verbose)

Expand Down

0 comments on commit 2cafaaf

Please sign in to comment.