AutoCAD Map 3D Forum
Welcome to Autodesk’s AutoCAD Map 3D Forums. Share your knowledge, ask questions, and explore popular AutoCAD Map 3D topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

List of coord system short names?

17 REPLIES 17
SOLVED
Reply
Message 1 of 18
JamesMaeding
1032 Views, 17 Replies

List of coord system short names?

I typically type in my coord system codes, like CA83-VIF to most dialogs, as I know the common ones for tasks I do.

I am making a program that needs to recognize those codes, and decide what system to set up with.

 

I am using the dotspatial library and c#, so I need to be sure I am setting up on the same system as map is for a given code.

Is there some lookup list out there with the short and full names of the systems?

 

I was surprised to find after a lot of looking, that everyone else seems to use the names from:

http://www.epsg.org/

but there are no short names in their database tables.

 

Is there a term for those short names? Maybe I am serching the wrong terms.

How do autodesk products convert between the short and full system names?

thx


internal protected virtual unsafe Human() : mostlyHarmless
I'm just here for the Shelties

17 REPLIES 17
Message 2 of 18
O_Eckmann
in reply to: JamesMaeding

Hi,

 

I'm not sure to well understand your problem, but here is a C# code to iterate thru list of MAP Coordinate System

 

Olivier

Olivier Eckmann

EESignature

Message 3 of 18
JamesMaeding
in reply to: O_Eckmann

you nailed it. The CSCode property is the short name I was looking for. thanks!


internal protected virtual unsafe Human() : mostlyHarmless
I'm just here for the Shelties

Message 4 of 18
JamesMaeding
in reply to: JamesMaeding

wow, this started me down a new rabbit hole.

 

I have been using dotspatial for rather basic things like converting coordinates.

I see now that adesk is using the mapguide tools for their GIS engine, though I'm sure I was told that numerous times before.

 

So I downloaded the latest, and looked at the install files.

Low and behold, they have the same stuff in:

<downloaded folder>\CS-Map\Dictionaries\

as:

C:\ProgramData\Autodesk\Geospatial Coordinate Systems 14.01

 

so that is where that came from.

 

So now I am trying to figure out how to transform a point from one system to another.

I am not finding too many examples of using mapguide with .net, but am just wading into it.

I did see the transform methods, but not how to specify the from and to systems...


internal protected virtual unsafe Human() : mostlyHarmless
I'm just here for the Shelties

Message 5 of 18
O_Eckmann
in reply to: JamesMaeding

Hi,

 

Here is another sample from ADN dev blog, Hope this is useful.

 

Olivier

Olivier Eckmann

EESignature

Message 6 of 18
JamesMaeding
in reply to: O_Eckmann

right on, exactly what I needed because I was getting stuck on if you use the mgpoint or coordinate object.

How does anyone figure this stuff out?

The help seems to get close, but acts like you are already good with the api.

Is there some place to go to read about basics like this?


internal protected virtual unsafe Human() : mostlyHarmless
I'm just here for the Shelties

Message 7 of 18
mchan01
in reply to: O_Eckmann

Is it possible not use the Mapguide API for this?

 

because if you use the command ADESETCRDSYS and click the "select coordinates system" and leave  the code field blank, then you can see all epsg code listed.

 

Is autocad also referencing to mapguide?

Message 8 of 18
JamesMaeding
in reply to: mchan01

YES! Which is great news for people like me that want to do GIS things without acad map.

You see, the GIS engine of Map is open source and has a .net API.

Just obtain the osgeo dlls and add as references to your project like this (ignore the other references shown):

geo.jpg

 

You have no idea how happy I was to discover this way back.

When you download the osgeo stuff, it has a folder of coordinate system files you would need if you don't have acad map installed.

So its not just 3 dll's, but a bit more I can explain if anyone wants to make a .net prog using them.

 

If you meant without using the mapguide api at all, I have not found a way, and I spent a fair amount of time trying.

Why bother though, its free.


internal protected virtual unsafe Human() : mostlyHarmless
I'm just here for the Shelties

Message 9 of 18
mchan01
in reply to: JamesMaeding

THanks.

 

I am trying to do a stand alone apps using those 3 dlls and copied the directories folders of the CS map.

 

But i am getting a dependecy error on Mapguide.Foundation.

 

Any ideas?

Message 10 of 18
JamesMaeding
in reply to: mchan01

when do you get the error, on compile or when running?

Do you have the data stuff in place?

C:\ProgramData\Autodesk\Geospatial Coordinate Systems\

 

That will be there if you have acad installed. If not, you must obtain it and make sure your standalone app can find it.

It was in the download I used:

MapGuideOpenSource-2.6.0.8316-InstantSetup-x64.exe

 

Be more specific and we can get it working. I'll do a test app if we need to.


internal protected virtual unsafe Human() : mostlyHarmless
I'm just here for the Shelties

Message 11 of 18
mchan01
in reply to: JamesMaeding

Error is at 

 MgCoordinateSystemFactory coordSysFactory = new MgCoordinateSystemFactory();

PInvoke error on mggeometry

 

 

Yep, ive have the folder for the CS from autodesk, i also have mapguide opensource installed and have a running apps using those dlls

 

thanks

 

Message 12 of 18
fieldguy
in reply to: mchan01

IIRC the dependency is on PresentationCore.  You can add the reference from Assemblies->Framework.  You should see the required reference in the error msg.

 

presentationcore.PNG

 

 

 

 

Message 13 of 18
JamesMaeding
in reply to: fieldguy

ah, worth a kudo! Thx for jumping in on that.


internal protected virtual unsafe Human() : mostlyHarmless
I'm just here for the Shelties

Message 14 of 18
mchan01
in reply to: fieldguy

Thanks for the help guys, but still having the same error.

 

Anything i ref from mapguide is causing an exception error.

 

I have a running mapguide project and it works ok, and i used the same dll its using. But its weird that this is bombing out.

Message 15 of 18
mchan01
in reply to: JamesMaeding

Hi JMeading.

 

Was able to make the app work, now I wanted to get categories, but accessing it is quite slow. Have you tried it?

 

mgcs.GetCategories()

then mgcs.GetCategories().getItem(1)

 

are those the only ways to get all categories? because I am planning to make a drop down list of all categories and make a search selection for it.

 

Thanks

 

Regards

Message 16 of 18
JamesMaeding
in reply to: mchan01

Hey there,

No speed issues for me so far, though I may be accessing things differently than you:

 

//the point of this is to find short names for the systems
        [CommandMethod("ListCoordSystems")]
        public void ListCoordSystems() {
            //list items for mapguide
            MgCoordinateSystemFactory coordSysFactory = new MgCoordinateSystemFactory();
            MgCoordinateSystemCatalog csCatalog = coordSysFactory.GetCatalog();
            MgCoordinateSystemDictionary csDict = csCatalog.GetCoordinateSystemDictionary();
            MgCoordinateSystemEnum csDictEnum = csDict.GetEnum();

            int csCount = csDict.GetSize();

            MgStringCollection csNames = csDictEnum.NextName(csCount);
            string csName = null;
            MgCoordinateSystem cs = null;
            List<string> txtout = new List<string>();
            AcEd.Editor ed = AcAp.DocumentManager.MdiActiveDocument.Editor;
            for (int i = 0; i < csCount; i++) {
                csName = csNames.GetItem(i);
                cs = csDict.GetCoordinateSystem(csName);
                if (cs.CsCode == "") {
                    ed.WriteMessage("\nNo CS Code for EPSG " + cs.EpsgCode.ToString());
                }
                txtout.Add(cs.EpsgCode + "," + cs.CsCode + "," + cs.Description.Replace(",", "|"));
            }
            //write to file
            HAStr.TextToFile("c:\\temp\\GIS Codes.csv", txtout);
            ed.WriteMessage("\nWritten to c:\\temp\\GIS Codes.csv");
        }

I think that is looping through the whole system, so worst case in terms of speed.

See if that  code does better.

thx


internal protected virtual unsafe Human() : mostlyHarmless
I'm just here for the Shelties

Message 17 of 18
mchan01
in reply to: JamesMaeding

Yes, im doing the same code and its fast.

 

But the concern is accessing the Categories of each CS?

 

because my goal is to build something similar to the Coordinate System Library form in civil 3d. If you look at it, there is a combo box with all the categories etc. lat long, Africa, Algeria, US and etc..... and everytime to make a selection it filters your list.

 

I am doing something like that, but to get all those categories, the only methods I see to access it is MGCoordinatesSsystem.GetCategories() then I have to Itemrate on that by using For statement on  GetItem(x). But calling both functions takes time.. the CS list is around 6800+, Ive been running the code for 20 misn and the numbers ive processed is around 685.

 

 

Message 18 of 18
mchan01
in reply to: JamesMaeding

Hi,

 

I am trying to deploy this on IIS, ive created  a web api. Ive used the 64bit version of mapguide. On my development its running fine, but when I put it on IIS I am getting an error.

 

Unable to load DLL 'GeometryUnmanagedApi': The specified module could not be found.

 

but I do have that on my bin folder and even tried copying it on inetserv folder.

 

Any ideas?

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost