好久没来更新了。最近要实现空间数据转换功能,在网上看到FME在空间数据转换方面的强大功能。并且支持基于组件FMEObjects的应用开发,于是到网上先找破解的来试一下。没想到颇费了一番周折才下载到一个FME2006的破解文件,想下载一个2007版的破解,结果找到的都不能下载。2006的这个破解文件很好用,拿来和大家分享一下。/Files/xshy3412/fme2006keygen.rar。限于上传空间有限,只把破解文件传上来了,我用的安装文件是fme2692。在安图的ftp上可以下载得到。至于怎么安装和破解,到网上搜一下可以找到很多资料,不再赘述。
下面代码是一个用FMEObjects开发的简单例子,比照它的开发文档做的。
下面代码是一个用FMEObjects开发的简单例子,比照它的开发文档做的。
using System;
using System.Collections.Generic;
using System.Text;
using Safe.FMEObjects;
using System.Collections.Specialized;
using System.Collections.Generic;
namespace TestFme
{
class ConvertWithoutDialog
{
public void BeginConvert()
{
// Creates the session
IFMEOSession fmeSession = FMEObjects.CreateSession();
fmeSession.Init(null);
// Creates a GML2 reader
IFMEOReader fmeReader = fmeSession.CreateReader("MAPINFO", false, null);
// Opens the specified source dataset
StringCollection readerParams = new StringCollection();
fmeReader.Open(@"F:\mapinfo", readerParams);
// Creates an IGDS writer
IFMEOWriter fmeWriter = fmeSession.CreateWriter("GML", null);
// Opens the specified destination dataset
StringCollection writerParams = new StringCollection();
writerParams.Add("COMPUTE_SEED_FILE_PARMS");
writerParams.Add("yes");
fmeWriter.Open(@"F:\gml\zhouzhi.xml", writerParams);
// Reads in all schema features
IFMEOFeature fmeSchemaFeature = fmeSession.CreateFeature();
while (fmeReader.ReadSchema(fmeSchemaFeature))
{
fmeWriter.AddSchema(fmeSchemaFeature);
}
fmeSchemaFeature.Dispose();
// Reads and writes all features
IFMEOFeature fmeFeature = fmeSession.CreateFeature();
while (fmeReader.Read(fmeFeature))
{
fmeWriter.Write(fmeFeature);
}
fmeFeature.Dispose();
// Close reader and writer
fmeWriter.Close();
fmeReader.Close();
// Final Clean up
fmeSession.Dispose();
}
}
}
using System.Collections.Generic;
using System.Text;
using Safe.FMEObjects;
using System.Collections.Specialized;
using System.Collections.Generic;
namespace TestFme
{
class ConvertWithoutDialog
{
public void BeginConvert()
{
// Creates the session
IFMEOSession fmeSession = FMEObjects.CreateSession();
fmeSession.Init(null);
// Creates a GML2 reader
IFMEOReader fmeReader = fmeSession.CreateReader("MAPINFO", false, null);
// Opens the specified source dataset
StringCollection readerParams = new StringCollection();
fmeReader.Open(@"F:\mapinfo", readerParams);
// Creates an IGDS writer
IFMEOWriter fmeWriter = fmeSession.CreateWriter("GML", null);
// Opens the specified destination dataset
StringCollection writerParams = new StringCollection();
writerParams.Add("COMPUTE_SEED_FILE_PARMS");
writerParams.Add("yes");
fmeWriter.Open(@"F:\gml\zhouzhi.xml", writerParams);
// Reads in all schema features
IFMEOFeature fmeSchemaFeature = fmeSession.CreateFeature();
while (fmeReader.ReadSchema(fmeSchemaFeature))
{
fmeWriter.AddSchema(fmeSchemaFeature);
}
fmeSchemaFeature.Dispose();
// Reads and writes all features
IFMEOFeature fmeFeature = fmeSession.CreateFeature();
while (fmeReader.Read(fmeFeature))
{
fmeWriter.Write(fmeFeature);
}
fmeFeature.Dispose();
// Close reader and writer
fmeWriter.Close();
fmeReader.Close();
// Final Clean up
fmeSession.Dispose();
}
}
}