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

Autodesk Infrastructure GeoREST Extension 2012 - 64BIT

16 REPLIES 16
SOLVED
Reply
Message 1 of 17
gluckett
2124 Views, 16 Replies

Autodesk Infrastructure GeoREST Extension 2012 - 64BIT

In the Preview stuff (technical term) - the GeoRest is installed.from the C:\Autodesk\Autodesk_Infrastructure_Map_Server_2012_English_Win_64bit\TechnologyPreview

 

I have it working great on IIS for direct connect (i.e. FDO Features) but when I connect to AIMS 2012 - I get "MgConnectionFailedException".

 

I know GeoRest is configured ok since it works with direct connect data (i.e. path to SDF or ConnectString to SQL Server).

 

I am testing with the config.xml that comes with the GeoRest and points to the sample dataset (installed).

<Resource uripart="propertymap">
<Source type="MapGuide">
<FeatureSource>Library://Samples/Sheboygan/Data/Parcels.FeatureSource</FeatureSource>
<FeatureClass>SHP_Schema:Parcels</FeatureClass>
</Source>

 

I know I have Library://Samples/Sheboygan/Data/Parcels.FeatureSource available.

 

Any tips?

 

gordon

 

16 REPLIES 16
Message 2 of 17
gluckett
in reply to: gluckett

Discovered the issue.  The ports changed with AIMS 2012.

 

Old connection

 

<Resourceuripart="property">
     
<Sourcetype="MapGuide">
     
<FeatureSource>Library://Samples/Sheboygan/Data/Parcels.FeatureSource</FeatureSource>
     
<FeatureClass>SHP_Schema:Parcels</FeatureClass>
     
<ServerIp>192.168.0.33</ServerIp>
     
<ServerPort>2812</ServerPort>
     
</Source>
   
</Resource>
NOW WITH AIMS 2012 the server port is "2822"
<Resourceuripart="property">
     
<Sourcetype="MapGuide">
     
<FeatureSource>Library://Samples/Sheboygan/Data/Parcels.FeatureSource</FeatureSource>
     
<FeatureClass>SHP_Schema:Parcels</FeatureClass>
     
<ServerIp>192.168.0.33</ServerIp>
     
<ServerPort>2822</ServerPort>
     
</Source>
   
</Resource>
Message 3 of 17
ericsn.tang
in reply to: gluckett

Now I'm able to access the source type "mapguide" and use the example "Property" parameters via the url http://localhost/rest/data/property_/11530.html

The attribute were displayed without problem, but it can't to generate the map image!

 

 <tr>
            <td width="200">Image Representation</td>
            <td><a href="../www/Image/{{PROPERTY_Autogenerated_SDF_ID}}.png">{{PROPERTY_Autogenerated_SDF_ID}}.png</a></td>
 </tr> 

 

Anyone have idea? Thanks.

Message 4 of 17
gluckett
in reply to: ericsn.tang

Make sure that line 83 "Image" is configured.

 

C:\Program Files\Autodesk\Autodesk Infrastructure Web Server Extension 2014\www\GeoREST\conf\SheboyganMap\restcfg.xml

 

This uses the AIMS Sheboygan map to get the image.

http://localhost/rest/data/Image/11530.png

 

 

 

 

Message 5 of 17
ericsn.tang
in reply to: gluckett

Thanks.

I did changed the serverport. The error message "Failed to retrieve message for "MgConnectionFailedException"." is disappear, but the image cannot be generated properly! The webpage(http://127.0.0.1/rest/data/Image/1.png) is empty in IE7. I think the problem is the PNG image generation. 😞

 

 

 

Message 6 of 17
DEVR1105
in reply to: ericsn.tang

Make sure you have the correct ServerIp and ServerPort for your AIMS install for that data in AIMS for the image.
Message 7 of 17
ericsn.tang
in reply to: DEVR1105

Thanks. I did tried to update the serverconfig, webconfig, restcfg files. Which file should I update for the image path setting? 🙂
Message 8 of 17
gluckett
in reply to: ericsn.tang

The image component comes from the config file  

C:\Program

Files\Autodesk\Autodesk Infrastructure Web Server Extension

2014\www\GeoREST\conf\SheboyganMap\restcfg.xml

 

Around line 83

 

<Resource uripart="Image">
<Source type="MapGuide">
<FeatureSource>Library://Samples/Sheboygan/Data/Parcels.FeatureSource</FeatureSource>
<FeatureClass>SHP_Schema:Parcels</FeatureClass>
<ServerIp>127.0.0.1</ServerIp>
<ServerPort>2812</ServerPort>
</Source>

 

be sure that the Port is correct.  Check out your serverconfig.ini to ensure 2812 is correct...

 

 

 

Message 9 of 17
ericsn.tang
in reply to: gluckett

Thanks.

 

I think it seems that it is caused by the image path, because I tried to change the server ip or server port of the rectcfg file. The image box will show a cross symbol in IE browser, if the wrong port was used. The following screen capture shows the difference server port were used.

Tags (1)
Message 10 of 17
gluckett
in reply to: ericsn.tang

So the MGP for Sheboygan was loaded on your AIMS server in the default folders? 

The PORT is correct?

 

In my class at AU, I use the defualt Autodesk installs and tweak the xml to ensure it is correctly installed.  

 

The "IMAGE" path requires that Sheboygan is available and that you are using AIMS (with IIS).

 

 

Message 11 of 17
ericsn.tang
in reply to: gluckett

Eventually it works! The map can be generated, but it is only support the feature type which is the polygon type! Is it true? Once I used the point feature, the message "Failed to retrieve message for "MgInvalidArgumentException". [SETVIEWSCALE] = "0" Failed to retrieve message for "MgValueCannotBeLessThanOrEqualToZero"." will prompt.

Message 12 of 17
reno.sun.gis
in reply to: gluckett

Hi 🙂

 

I don't know if you noticed that GeoRest actually generate PNG/JPEG images slowly. It took about 30 secs to generate every PNG images in my case.

 

Therefore, you will not see the images showed up properly on your GeoRest many/single template pages.

 

In my opinion, you can probably use C# or other programming languages to create a small GeoRest images pre-geneartion application to generate all the images that you need.

 

The code will be very similar as following:

 

int start = Int32.Parse(StarttextBox.Text);
int end = Int32.Parse(EndtextBox.Text);

for (int i = start; i <= end; i++)
{
string sourceUrl = @"http://localhost/rest/data/test/" + i.ToString() + ".png";
string localPath = @"C:\inetpub\wwwroot\test\png\" + i.ToString() + ".png";
byte[] imageBytes;
HttpWebRequest imageRequest = (HttpWebRequest)WebRequest.Create(sourceUrl);
WebResponse imageResponse = imageRequest.GetResponse();

Stream responseStream = imageResponse.GetResponseStream();

using (BinaryReader br = new BinaryReader(responseStream))
{
imageBytes = br.ReadBytes(500000);
br.Close();
}
responseStream.Close();
imageResponse.Close();

FileStream fs = new FileStream(localPath, FileMode.Create);
BinaryWriter bw = new BinaryWriter(fs);
try
{
bw.Write(imageBytes);
}
finally
{
fs.Close();
bw.Close();
}

 

Hope that will help you 🙂

Message 13 of 17
gluckett
in reply to: reno.sun.gis

For those stuggling with the GeoRest bundled with AIMS, I also would recommend the new mapguide-rest project started by Jackie Ng.
It is dead easy to set up and works really quickly.

It uses AIMS 100% (sorry no direct connect to FDO) - but it is very slick and faster than GeoREST.

http://themapguyde.blogspot.ca/2014/02/introducing-mapguide-rest-new-rest.html

https://github.com/jumpinjackie/mapguide-rest
Message 14 of 17
jackie.ng
in reply to: ericsn.tang

Before anybody gets too excited, mapguide-rest is not production-ready yet.

 

There's still some security hardening to be done before I can safely say that you can put this to production use.

 

Sure, download the current release to have a play around and see what it can do, but I strongly discourage production deployment at this point in time, especially on public-facing MapGuide/AIMS installations.

 

- Jackie

Message 15 of 17
gluckett
in reply to: jackie.ng

Still, your prototype ("Alpha") is very promising and slick. We should all keep an eye on the mapguide-rest project.
Message 16 of 17
ericsn.tang
in reply to: gluckett

Is there someone try to use the post/ put of georest? I want to update/ create a new entries for the specific SDF connection. How can I generate the SHPGEOM from the fusion viewer? 🙂 

 

<Name>SHPGEOM</Name>
<Value>
POLYGON ((-87.750602148149582 43.772512943108723, -87.750820980626941 43.772509600594994,
-87.751112034446564 43.772505154303111, -87.751191267124568 43.772701180970984, -87.750821769925366
43.772706826945878, -87.750681379906538 43.77270897188734, -87.750664555803112 43.772667347110961,
-87.750602148149582 43.772512943108723))

Message 17 of 17
gluckett
in reply to: ericsn.tang

Check out the classic GeoREST (Comes with AIMS) how to put post and get data to a SDF or SHP.

 

He is my presentation at Autodesk University.

 

http://au.autodesk.com/au-online/classes-on-demand/class-catalog/2013/infrastructure-map-server/gs15...

 

 

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

Post to forums  

Autodesk Design & Make Report