Skip to main content

Hi,

I have a hundred of mapinfo files that I would like to convert to shapefile.

 

 

It is obvious to write a workspace that works for one file but it not obvious for me to write a batch (MSDOS) that will convert all the mapinfo files.

I tried to riun my workspace in a batch script but it is not working when I'm changing the SourceDataset_MITAB to another mapinfo file.

"C:\Program Files\FME\fme.exe" Y:\tmp\siurs\script\mitab2shape.fmw --SourceDataset_MITAB C:\Users\xkaptar\Documents\SIURS\projet\mapinfo\Ville.tab --DestDataset_SHAPE C:\Users\xkaptar\Documents\SIURS\projet\shapefile

What I want is to have an input file <filename.tab> and the output should be <filename.shp>  (with the other extensions <filename.shx>, <filename.dbx>, ...).

Thanks

 

You will need to set up a dynamic workflow. This article should help you as there are samples you can copy. But if you set up a dynamic reader and writer and fan out your writer by your fme basename you will achieve your required output.

https://knowledge.safe.com/articles/1050/dynamic-workflow-tutorial-introduction.html


You will need to set up a dynamic workflow. This article should help you as there are samples you can copy. But if you set up a dynamic reader and writer and fan out your writer by your fme basename you will achieve your required output.

https://knowledge.safe.com/articles/1050/dynamic-workflow-tutorial-introduction.html

@ciarab, The dynamork space solve partially my issue.

 

As output, iInstead of having <filename.shp>, I will have <filename_polygon.shp>.

 

How can I fix it?

Do you know you only have polygons in the input data @arthy ? I see the issue and am thinking...we add the suffix if we think there may be more types of geometry coming to the shape file, which can only handle one kind of geometry. But it is true that this is an undesirable name if it is not needed.


Do you know you only have polygons in the input data @arthy ? I see the issue and am thinking...we add the suffix if we think there may be more types of geometry coming to the shape file, which can only handle one kind of geometry. But it is true that this is an undesirable name if it is not needed.

@daleatsafe,

 

The problem is not the type of geometry inside the file.

 

I don't want to see the type of geometry in the name of the output file.

 

So what should I do?

 

 

 


@arthy

I have attached a sample, try splitting out your data with a geometry filter and have a number of different writers for each geometry. Set your writer geometry type and then your output file name should not include the _polygon. Hope that helps

sample.fmw


@arthy

I have attached a sample, try splitting out your data with a geometry filter and have a number of different writers for each geometry. Set your writer geometry type and then your output file name should not include the _polygon. Hope that helps

sample.fmw

@ciarab,

 

I tried to used your sample, but no shapefile is written. For a test I'm using the following tabs

 

I added a geometry filter in my worksape but I also have the suffixe _polygon in the output.

 

 


@ciarab,

 

I tried to used your sample, but no shapefile is written. For a test I'm using the following tabs

 

I added a geometry filter in my worksape but I also have the suffixe _polygon in the output.

 

 

sample.fmwt

 

 

@arthy once I set the geometry type in the writer then the suffix is removed from my output. I will upload a template with the sample data which you can run, I think this should work for you its working on my side

 

 

 

 

 

 

 

 

 


Reply