Spatial References are not compatible

705
0
04-30-2012 10:43 PM
runegullstrom
New Contributor
Hi all,

I'm getting the above error for some layers when querying the db using st_geometry functions. Without going into the specifics of why and how:
I'd like to clean up the database so that I'm left with only unambiguous entries in the spatial_references table for the projections I use.
I'm having 59 rows! in the spatial_references table at the moment for the dev environment.
Of course the majority define the same projection but are created as seperate entries when one of the attributes is slightly different.

Getting to my question: how do I
1. 'reproject' the feature classes to have the same srid in the spatial references table.
    - I tried batch reproject using a feature class with the desired projection but still ended up with a different projection in the spatial references table after projection than the projection of the template feature class.
    - I can achieve my goal with ArcCatalogue by creating a new feature class and defining the projection by pointing it to a feature class with the desired srid, but I'm looking for a scripted solution.
      I can't do this using CreateFeatureclass_management because the help states "When you use a Template Feature Class its spatial reference is ignored". But I need to use a template feature class
      to define the attribute schema. So that looks like a catch 22 to me.
2. force new data to be loaded in the database to use only the (maybe) 3 projections that I like to be left with.
3. delete all the obsolete entries from the spatial_refences table after I succeeded at step 1?

I know there are entries on this topic on the forum (e.g. http://forums.esri.com/Thread.asp?c=158&f=2291&t=298774) but they don't seem to cut the cake.
I'm looking for a scripted solution.

regards,

Rune
0 Kudos
0 Replies