Nous utilisons des cookies pour vous garantir la meilleure expérience sur notre site. Si vous continuez à utiliser ce dernier, nous considèrerons que vous acceptez l'utilisation des cookies. J'ai compris ! ou En savoir plus !.
banniere

Le portail francophone de la géomatique


Toujours pas inscrit ? Mot de passe oublié ?
Nom d'utilisateur    Mot de passe              Toujours pas inscrit ?   Mot de passe oublié ?

Annonce

GEODATA DAYS 2024

#1 Mon 19 February 2007 10:42

Nicolas2603
Participant occasionnel
Lieu: Paris
Date d'inscription: 6 Jan 2006
Messages: 15

Ouvrir un fichier ASC dans ArcGis 9.1

Bonjour, on m'a envoyé un fichier ASC, que je souhaite ouvrir dans ArcGis 9.1, mais je ne trouve nulle part l'option qui permet d'ouvrir ce genre de fichier, et je ne trouve aucune info dans le manuel. Faut-il faire une conversion avant ? Merci d'avance.

Hors ligne

 

#2 Mon 19 February 2007 11:27

Olivier De LA POMMERAYE
Invité

Re: Ouvrir un fichier ASC dans ArcGis 9.1

Attention il faut avoir l'extension Spatial Analyst pour faire cela.
Voici les commandes à faire décrite dans l'aide ArcGIS :
- ASCIIToRaster_conversion pour la ligne de commande
- ASCIIGrid dans l'outil Map Algebra

Bon travail,

Olivier

ASCIIGrid

Show Related Topics

Converts an appropriately formatted ASCII file to a raster.

Usage tips

      Map Algebra
    *

      The ASCII file must consist of header information containing a
set of keywords, followed by cell values in row-major order. The file
format is

<NCOLS xxx>
<NROWS xxx>
<XLLCENTER xxx | XLLCORNER xxx>
<YLLCENTER xxx | YLLCORNER xxx>
<CELLSIZE xxx>
{NODATA_VALUE xxx}
row 1
row 2
.
.
.
row n

      where xxx is a number and the keyword NODATA_VALUE is optional
and defaults to -9999. Row 1 of the data is at the top of the raster,
row 2 is just under row 1, and so on.For example:

ncols 480
nrows 450
xllcorner 378923
YLLCORNER 4072345
cellsize 30
nodata_value -32768
43 2 45 7 3 56 2 5 23 65 34 6 32 54 57 34 2 2 54 6
35 45 65 34 2 6 78 4 2 6 89 3 2 7 45 23 5 8 4 1 62  ...

    *

      The NODATA_VALUE is the value in the ASCII file assigned to those
cells whose true value is unknown. In the raster, they will be assigned
the keyword NODATA.
    *

      Cell values should be delimited by spaces. No carriage returns
are necessary at the end of each row in the raster. The number of
columns in the header determines when a new row begins.
    *

      The number of cell values must be equal to the number of rows
times the number of columns, or an error will be returned.

sub section Command line syntax
See ASCII to Raster

Scripting syntax
See ASCII to Raster

sub section Map Algebra syntax
ASCIIGrid(<in_ascii_file>, {INT | FLOAT})
Parameter     Explanation
<in_ascii_file>     The ASCII file to be converted.
{INT | FLOAT}     The data type of the output raster.

    * INT — An integer raster will be created.
    * FLOAT — A floating-point raster will be created.

Map Algebra example

asciigrid (infile.asc)

En ligne de commande :

ASCII To Raster (Conversion)

Show Related Topics Open tool dialog

Converts an ASCII file representing raster data to a raster dataset.

Usage tips

      Command line and Scripting
    *

      The ASCII file must consist of header information containing a
set of keywords, followed by cell values in row-major order. The file
format is

    <NCOLS xxx>
    <NROWS xxx>
    <XLLCENTER xxx | XLLCORNER xxx>
    <YLLCENTER xxx | YLLCORNER xxx>
    <CELLSIZE xxx>
    {NODATA_VALUE xxx}
    row 1
    row 2
    .
    .
    .
    row n

Note: xxx is a number and the keyword nodata_value is optional and
defaults to -9999. Row 1 of the data is at the top of the grid, row 2
is just under row 1, and so on.

      LLCENTER will use the center of the lowest left cell to provide a
location for the raster. LLCORNER will use the lower left corner of the
lowest left cell. Note that Raster To ASCII will only generate LLCORNER
ASCII files. For example:

    ncols 480
    nrows 450
    xllcorner 378923
    yllcorner 4072345
    cellsize 30
    nodata_value -32768
    43 2 45 7 3 56 2 5 23 65 34 6 32 54 57 34 2 2 54 6 ...
    35 45 65 34 2 6 78 4 2 6 89 3 2 7 45 23 5 8 4 1 62 ...

    *

      The nodata_value is the value in the ASCII file to be assigned to
those cells whose true value is unknown. In the raster, they will be
assigned to NoData.
    *

      Cell values should be delimited by spaces. No carriage returns
are necessary at the end of each row in the grid. The number of columns
in the header is used to determine when a new row begins.
    *

      The number of cell values must be equal to the number of rows
times the number of columns, or an error will be returned.
    *

      The output data type can be either float or integer.
    *

      The following environments affect this tool: current workspace,
scratch workspace, output coordinate system, output extent, output has
Z values, Z resolution, output CONFIG keyword, output spatial grid
1,2,3, output XY domain, output Z domain, output XY domain, output Z
domain, cell size, pyramid, raster statistics, compression, and tile
size.

sub section Command line syntax
An overview of the command line window

ASCIIToRaster_conversion <in_ascii_file> <out_raster>
{INTEGER | FLOAT}
Parameter     Explanation     Datatype
<in_ascii_file>     

The input ASCII file to be converted.
    File
<out_raster>     

The output raster dataset to be created.

When not saving to a geodatabase, specify .tif for a TIFF file format,
.img for an ERDAS IMAGINE file format, or no extension for a GRID file
format.
    Raster Dataset
{INTEGER | FLOAT}     

The data type of the output raster dataset.

    * INTEGER—An integer raster dataset will be created.
    * FLOAT—A floating-point raster dataset will be created.

    String
Data types for geoprocessing tool parameters

Command line example

ASCIIToRaster d:datawhitehorse.mdbsurveys.txt
d:Newdata.mdbsurveys.tif INTEGER

sub section Scripting syntax
An overview of scripting in geoprocessing

ASCIIToRaster_conversion (in_ascii_file, out_raster, data_type)
Parameter     Explanation     Datatype
in_ascii_file (Required)     

The input ASCII file to be converted.
    File
out_raster (Required)     

The output raster dataset to be created.

When not saving to a geodatabase, specify .tif for a TIFF file format,
.img for an ERDAS IMAGINE file format, or no extension for a GRID file
format.
    Raster Dataset
data_type (Optional)     

The data type of the output raster dataset.

    * INTEGER—An integer raster dataset will be created.
    * FLOAT—A floating-point raster dataset will be created.

    String
Data types for geoprocessing tool parameters

Script example

# ASCIIToRaster_sample.py
# Description:
#   Converts an ASCII file representing raster data to a raster.
# Requirements: None
# Author: ESRI
# Date: Oct 20, 2005

# Import system modules
import arcgisscripting

# Create the Geoprocessor object
gp = arcgisscripting.create()

try:
    # Set local variables
    InAsciiFile = "C:/data/raster2ascii.asc"
    OutRaster = "C:/data/raster1"

    # Process: ASCIIToRaster_conversion
    gp.ASCIIToRaster_conversion(InAsciiFile, OutRaster, "INTEGER")

except:
    # Print error message if an error occurs
    print gp.GetMessages()

sub section Map Algebra syntax
See ASCIIGrid. The Spatial Analyst extension must be present to use
this link.

sub section ArcObjects syntax
See ImportFromASCII. The Spatial Analyst extension must be present to
use this link.

 

#3 Mon 19 February 2007 22:54

Tnarbiv
Participant assidu
Lieu: Véretz
Date d'inscription: 5 Sep 2005
Messages: 392

Re: Ouvrir un fichier ASC dans ArcGis 9.1

bonjour,
tu as une commande dans ArcMap, dans le menu Outils qui s'appelle "Ajouter des données XY...".
Avant de faire cela vérifie que dans le répertoire où se situe ton fichier asc tu as bien un fichier schema.ini. Tu peux l'ouvrir avec bloc note et voir certaines infos.
sur la première ligne entre crochet tu as le nom du fichier asc
sur la deuxième ligne tu as le séparateur de champ.

ex:
[test.asc]
Format = CSVDelimited

si ton séparateur de champ dans ton fichier asc est le ; alors Format = CSVDelimited devient Format = Delimited(wink

si ton séparateur de champ dans ton fichier asc est la tabulation alors Format = CSVDelimited devient Format = TABDelimited et [test.asc] devient [test.tab]

c'est un exemple il peut y avoir d'autres solutions.

bon courage


Ayez le réflexe "Développement Durable": N'imprimez ce message que si nécessaire.

Hors ligne

 

#4 Mon 19 February 2007 22:57

Tnarbiv
Participant assidu
Lieu: Véretz
Date d'inscription: 5 Sep 2005
Messages: 392

Re: Ouvrir un fichier ASC dans ArcGis 9.1

tu peux aussi aller dans ArcGIS Desktop Help, dans l'onglet Index et taper "delimited text file data, accessing"

bon courage


Ayez le réflexe "Développement Durable": N'imprimez ce message que si nécessaire.

Hors ligne

 

Pied de page des forums

Powered by FluxBB