顯示具有 MapGuide 標籤的文章。 顯示所有文章
顯示具有 MapGuide 標籤的文章。 顯示所有文章

2011年8月2日 星期二

MapGuide Enterprise 2011 授权错误的解决办法

MapGuide Enterprise 2011 授权错误的解决办法

如果你以前使用的MapGuide Enterprise 2011试用版,在转为正式授权版后可能出现授权错误。比如在授权错误日志中频繁出现[The license has already been checked out] 错误,下面的解决办法也许适合你。
解决方案内容来自http://usa.autodesk.com/adsk/servlet/ps/dl/item?siteID=123112&id=15367639&linkID=9242178

错误现象:

在C:\Program Files\Autodesk\MapGuideEnterprise2011\Server\Logs\LicenseError.log 里面频繁出现下面的日志内容。
1400 2011/03/21 09:49:56 Reason=Fatal error
1400 2011/03/21 09:49:56 ComputerName=ALBAGEOMAP
1400 2011/03/21 09:49:56 OS=5.2.3790.Szervizcsomag 2
1400 2011/03/21 09:49:56 File=AdlmIntNWFBLicense.cpp,Line=622
1400 2011/03/21 09:49:56 AdlmIntError=18 [The license has already been checked out]

解决方案
1. 在LMTOOLS里确认有可用的License
打开LMTOOLS
到Server Status选显卡,点击Perform Status Enquiry按钮
检查 MapGuide 2011的授权是否有效,你应该能看到类似下面的东东:
"Users of 85552MAPGE_2011_0F: (Total of 1 license issued; Total of 0 licenses in use)"
2. 用记事本或其他文本编辑器打开serverconfig.ini文件,这个文件在\MapGuideEnterprise2011\Server\Bin目录下
编辑LicenseServerPath参数,使其指向你安装LMTOOLS的机器,本地安装情况下缺省是
LicenseServerPath =@127.0.0.1.
编辑SerialNumber参数,使其和你在LMTOOLS中的序列号一致,比如
SerialNumber = 123-12345678
3. 打开文本编辑器,在MapGuideEnterprise2011\Server\目录下创建一个licpath.lic文件,SERVER后面的值必须和你的LicenseServerPath的值一致。比如下面的示例:
SERVER 127.0.0.1 000000000000
USE_SERVER
4. 重新启动MapGuide Server服务。

2011年5月10日 星期二

Mapguide2011 License 驗證注意事項。

1) Go to serverconfig.ini in \MapGuideEnterprise2011\Server\Bin and open in a text editor.
Edit the LicenseServerPath variable to point to your LMTOOLS install. The default for a local install is: LicenseServerPath =@127.0.0.1.
Edit the SerialNumber variable to indicate the serial number in use by LMTOOLS, such as: SerialNumber = 123-12345678

2) Open a text editor and create a licpath.lic file in \MapGuideEnterprise2011\Server. The value after SERVER must match your LicenseServerPath entry. See the example below.

SERVER 127.0.0.1 000000000000
USE_SERVER

3) Restart the MapGuide service (Look under Windows Services)

4) 確認C:\Program Files\Autodesk\MapGuideEnterprise2011\Server路徑下是否存在LICPATH.LIC
若缺此檔案,請建立文字檔並命名為LICPATH.LIC,其內容為:
------------------------------------------------
SERVER 127.0.0.1 000000000000
USE_SERVER

5) Start Map Guide Studio

2011年4月27日 星期三

MgFeatureProperty

MgFeatureProperty is for object properties (ie. You have a feature class that has another nested class definition)

As for the process of adding points. It basically is

1. Create your feature source
1.1 Create a feature class definition for the feature source
1.2 Add any properties to the feature class
1.3 Set the geometry type of the feature class to points
1.4 Save this to a session resource.
1.5 Set the spatial context equal to the SRS of the current MgMap, otherwise the points you insert may not be where you think they are.
2. Create a layer definition that references the created feature source
2.1 Create or load the xml content for this layer definition
2.2 Save this to a session resource.
3. Create an MgInsertFeatures command
3.1 Set the first parameter className = name of your created feature class
3.2 Create a property collection
3.2.1 Fill the property collection with the values you want to insert. Each value corresponds to a property in your feature class.
3.2.2 For the point feature, insert a MgGeometryProperty object. As a MgGeometryProperty requires a MgByteReader for the geometry value, use a MgGeometryFactory to create your MgGeometry object and convert it to a MgByteReader with a MgAgfReaderWriter instance.
3.3 Add this MgInsertFeatures command to your MgFeatureCommandCollection
3.4 Finally, pass this MgFeatureCommandCollection to the UpdateFeatures() method of your MgFeatureService. Also give it the resource id of the feature source you created.
3.5 You may need to close any open MgFeatureReaders in the result of UpdateFeatures(), this is what the code you posted is trying to do.
4. Finally refresh the map on the client side (manual or programmatically) and the point should be there.

That's a high level overview of it all. There may be a few bits that are slightly incorrect, but that is the general process flow.