Missing pixels when extracting each pixel valueExtract pixel value for corresponding point location in Rextract all pixel values from a raster record to put in another tableR - extract georeferenced raster pixel colorHow to buffer pixels by their associated pixel values?Extract longitudinal pixel values from raster.list, save to data frameExtraction of pixel values in lines to each number of pixelsextracting residuals from pixel by pixel regressionHow to get each pixel value of raster, and compare with another image using gdal/python/bash/freeware?Extract raster pixel values along a polyline in PostGISDistance from each cell of value 1 to each cell of value 0

Why did IBM make the PC BIOS source code public?

Are there any low-level means to *exit* the Ethereal plane to a plane of my choosing?

What modifiers are added to the attack and damage rolls of this unique longbow from Waterdeep: Dragon Heist?

Because my friend asked me to

Is this bar slide trick shown on Cheers real or a visual effect?

Did Michelle Obama have a staff of 23; and Melania have a staff of 4?

When was "Fredo" an insult to Italian-Americans?

What can I do to increase the amount of LEDs I can power with a pro micro?

How would armour (and combat) change if the fighter didn't need to actually wear it?

A+ rating still unsecure by Google Chrome's opinion

A man in the desert is bitten by a skeletal animal, its skull gets stuck on his arm

Are there really no countries that protect Freedom of Speech as the United States does?

Graphs for which a calculus student can reasonably compute the arclength

What if a restaurant suddenly cannot accept credit cards, and the customer has no cash?

Is there a name for the technique in songs/poems, where the rhyming pattern primes the listener for a certain line, which never comes?

Unconventional examples of mathematical modelling

Do I need to start off my book by describing the character's "normal world"?

What should I do if actually I found a serious flaw in someone's PhD thesis and an article derived from that PhD thesis?

Solving a maximum minimum problem

Weird resistor with dots around it

What would cause a nuclear power plant to break down after 2000 years, but not sooner?

How can I find files in directories listed in a file?

How does the Moon's gravity affect Earth's oceans despite Earth's stronger gravitational pull?

Good textbook for queueing theory and performance modeling



Missing pixels when extracting each pixel value


Extract pixel value for corresponding point location in Rextract all pixel values from a raster record to put in another tableR - extract georeferenced raster pixel colorHow to buffer pixels by their associated pixel values?Extract longitudinal pixel values from raster.list, save to data frameExtraction of pixel values in lines to each number of pixelsextracting residuals from pixel by pixel regressionHow to get each pixel value of raster, and compare with another image using gdal/python/bash/freeware?Extract raster pixel values along a polyline in PostGISDistance from each cell of value 1 to each cell of value 0






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















enter image description hereWe are trying to convert lzw compressed raster(tiff) into text format(meaning extracting each pixel centroid and band1 value.. We see that some parts of the raster is missed while conversion.. however there is a pattern in miss data (data is coming in unequal striped pattern) Please see snapshot up .. Yellow dots shows the centroid converted while no overlap with yellow the data is missed while converting..



we have tried the tile size 128 and 256 but the output was different in both the cases



List<String> tiffExtensions = new ArrayList<>();
tiffExtensions.add(".tif");
tiffExtensions.add(".TIF");
tiffExtensions.add(".tiff");
tiffExtensions.add(".TIFF");

final scala.Option<CRS> crsNone = scala.Option.apply(null);
final scala.Option<Object> objectNone = scala.Option.apply(null);
final scala.Option<Object> numPartitionsObject = scala.Option.apply(new Integer(10));
final scala.Option<Object> tileSize = scala.Option.apply(Integer.parseInt("256"));
final scala.Option<Object> partitionBytes = scala.Option.apply(128l * 1024 * 1024);
HadoopGeoTiffRDD.Options options = new HadoopGeoTiffRDD.Options$().apply(
JavaConverters.asScalaIteratorConverter(tiffExtensions.iterator()).asScala().toSeq(), crsNone,
HadoopGeoTiffRDD.GEOTIFF_TIME_TAG_DEFAULT(), HadoopGeoTiffRDD.GEOTIFF_TIME_FORMAT_DEFAULT(), tileSize,
numPartitionsObject, partitionBytes, objectNone);
RDD<Tuple2<ProjectedExtent, Tile>> rasterImageRdd = HadoopGeoTiffRDD.spatial(new Path(rastedImageDir), options,
javaSparkContext.sc());
JavaRDD<Tuple2<ProjectedExtent, Tile>> rasterImageJavaRdd = rasterImageRdd.toJavaRDD();
JavaRDD<String> pixelRdd = rasterImageJavaRdd
.flatMap(new FlatMapFunction<Tuple2<ProjectedExtent, Tile>, String>()
private static final long serialVersionUID = -6395159549445351446L;

public Iterator<String> call(Tuple2<ProjectedExtent, Tile> v1) throws Exception
ArrayList<String> list = new ArrayList<String>();
Tile t = v1._2;
ProjectedExtent projectedExtent = v1._1;
ProjectedRaster<CellGrid> r = new ProjectedRaster<CellGrid>(
new Raster<CellGrid>(t, projectedExtent.extent()), projectedExtent.crs());
GeometryFactory geometryFactory = new GeometryFactory(new PrecisionModel(), 4283);
WKTWriter wktWriter = new WKTWriter();
for (int i = 0; i < t.rows(); i++)
for (int j = 0; j < t.cols(); j++)
StringBuilder sb = new StringBuilder();
if (!Double.isNaN(t.getDouble(j, i)))
Double elevation = t.getDouble(j, i);
Tuple2<Object, Object> longLatTupel = r.raster().rasterExtent().gridToMap(j, i);
if (longLatTupel._2() != null && longLatTupel._1() != null)
Double latitude = Double.parseDouble(longLatTupel._2() + "");
Double longitude = Double.parseDouble(longLatTupel._1() + "");
Point point = geometryFactory.createPoint(new Coordinate(longitude, latitude));
sb.append(elevation).append(TAB_SEP);
sb.append(point);
list.add(sb.toString());




return list.iterator();

);


_










share|improve this question
























  • [enter image description here] at the beginning has the image that we are talking off

    – ashish
    Mar 27 at 11:52











  • The issue is that the yellow dots should be fully overlapped with the black points (We are simply extracting Lat/long and elevation values from a Raster Image). The portion of the image where yellow dots are not overlapped means the data has not been extracted for those points. The no data has been handled in line "Double.isNaN(t.getDouble(j, i)". There is nothing in-memory We have converted everything back into disk and visualizing the image on QGIS, I have updated the code snippet with comments which might help you in further understanding. I appreciate you helping on this

    – ashish
    Mar 28 at 5:28

















0















enter image description hereWe are trying to convert lzw compressed raster(tiff) into text format(meaning extracting each pixel centroid and band1 value.. We see that some parts of the raster is missed while conversion.. however there is a pattern in miss data (data is coming in unequal striped pattern) Please see snapshot up .. Yellow dots shows the centroid converted while no overlap with yellow the data is missed while converting..



we have tried the tile size 128 and 256 but the output was different in both the cases



List<String> tiffExtensions = new ArrayList<>();
tiffExtensions.add(".tif");
tiffExtensions.add(".TIF");
tiffExtensions.add(".tiff");
tiffExtensions.add(".TIFF");

final scala.Option<CRS> crsNone = scala.Option.apply(null);
final scala.Option<Object> objectNone = scala.Option.apply(null);
final scala.Option<Object> numPartitionsObject = scala.Option.apply(new Integer(10));
final scala.Option<Object> tileSize = scala.Option.apply(Integer.parseInt("256"));
final scala.Option<Object> partitionBytes = scala.Option.apply(128l * 1024 * 1024);
HadoopGeoTiffRDD.Options options = new HadoopGeoTiffRDD.Options$().apply(
JavaConverters.asScalaIteratorConverter(tiffExtensions.iterator()).asScala().toSeq(), crsNone,
HadoopGeoTiffRDD.GEOTIFF_TIME_TAG_DEFAULT(), HadoopGeoTiffRDD.GEOTIFF_TIME_FORMAT_DEFAULT(), tileSize,
numPartitionsObject, partitionBytes, objectNone);
RDD<Tuple2<ProjectedExtent, Tile>> rasterImageRdd = HadoopGeoTiffRDD.spatial(new Path(rastedImageDir), options,
javaSparkContext.sc());
JavaRDD<Tuple2<ProjectedExtent, Tile>> rasterImageJavaRdd = rasterImageRdd.toJavaRDD();
JavaRDD<String> pixelRdd = rasterImageJavaRdd
.flatMap(new FlatMapFunction<Tuple2<ProjectedExtent, Tile>, String>()
private static final long serialVersionUID = -6395159549445351446L;

public Iterator<String> call(Tuple2<ProjectedExtent, Tile> v1) throws Exception
ArrayList<String> list = new ArrayList<String>();
Tile t = v1._2;
ProjectedExtent projectedExtent = v1._1;
ProjectedRaster<CellGrid> r = new ProjectedRaster<CellGrid>(
new Raster<CellGrid>(t, projectedExtent.extent()), projectedExtent.crs());
GeometryFactory geometryFactory = new GeometryFactory(new PrecisionModel(), 4283);
WKTWriter wktWriter = new WKTWriter();
for (int i = 0; i < t.rows(); i++)
for (int j = 0; j < t.cols(); j++)
StringBuilder sb = new StringBuilder();
if (!Double.isNaN(t.getDouble(j, i)))
Double elevation = t.getDouble(j, i);
Tuple2<Object, Object> longLatTupel = r.raster().rasterExtent().gridToMap(j, i);
if (longLatTupel._2() != null && longLatTupel._1() != null)
Double latitude = Double.parseDouble(longLatTupel._2() + "");
Double longitude = Double.parseDouble(longLatTupel._1() + "");
Point point = geometryFactory.createPoint(new Coordinate(longitude, latitude));
sb.append(elevation).append(TAB_SEP);
sb.append(point);
list.add(sb.toString());




return list.iterator();

);


_










share|improve this question
























  • [enter image description here] at the beginning has the image that we are talking off

    – ashish
    Mar 27 at 11:52











  • The issue is that the yellow dots should be fully overlapped with the black points (We are simply extracting Lat/long and elevation values from a Raster Image). The portion of the image where yellow dots are not overlapped means the data has not been extracted for those points. The no data has been handled in line "Double.isNaN(t.getDouble(j, i)". There is nothing in-memory We have converted everything back into disk and visualizing the image on QGIS, I have updated the code snippet with comments which might help you in further understanding. I appreciate you helping on this

    – ashish
    Mar 28 at 5:28













0












0








0








enter image description hereWe are trying to convert lzw compressed raster(tiff) into text format(meaning extracting each pixel centroid and band1 value.. We see that some parts of the raster is missed while conversion.. however there is a pattern in miss data (data is coming in unequal striped pattern) Please see snapshot up .. Yellow dots shows the centroid converted while no overlap with yellow the data is missed while converting..



we have tried the tile size 128 and 256 but the output was different in both the cases



List<String> tiffExtensions = new ArrayList<>();
tiffExtensions.add(".tif");
tiffExtensions.add(".TIF");
tiffExtensions.add(".tiff");
tiffExtensions.add(".TIFF");

final scala.Option<CRS> crsNone = scala.Option.apply(null);
final scala.Option<Object> objectNone = scala.Option.apply(null);
final scala.Option<Object> numPartitionsObject = scala.Option.apply(new Integer(10));
final scala.Option<Object> tileSize = scala.Option.apply(Integer.parseInt("256"));
final scala.Option<Object> partitionBytes = scala.Option.apply(128l * 1024 * 1024);
HadoopGeoTiffRDD.Options options = new HadoopGeoTiffRDD.Options$().apply(
JavaConverters.asScalaIteratorConverter(tiffExtensions.iterator()).asScala().toSeq(), crsNone,
HadoopGeoTiffRDD.GEOTIFF_TIME_TAG_DEFAULT(), HadoopGeoTiffRDD.GEOTIFF_TIME_FORMAT_DEFAULT(), tileSize,
numPartitionsObject, partitionBytes, objectNone);
RDD<Tuple2<ProjectedExtent, Tile>> rasterImageRdd = HadoopGeoTiffRDD.spatial(new Path(rastedImageDir), options,
javaSparkContext.sc());
JavaRDD<Tuple2<ProjectedExtent, Tile>> rasterImageJavaRdd = rasterImageRdd.toJavaRDD();
JavaRDD<String> pixelRdd = rasterImageJavaRdd
.flatMap(new FlatMapFunction<Tuple2<ProjectedExtent, Tile>, String>()
private static final long serialVersionUID = -6395159549445351446L;

public Iterator<String> call(Tuple2<ProjectedExtent, Tile> v1) throws Exception
ArrayList<String> list = new ArrayList<String>();
Tile t = v1._2;
ProjectedExtent projectedExtent = v1._1;
ProjectedRaster<CellGrid> r = new ProjectedRaster<CellGrid>(
new Raster<CellGrid>(t, projectedExtent.extent()), projectedExtent.crs());
GeometryFactory geometryFactory = new GeometryFactory(new PrecisionModel(), 4283);
WKTWriter wktWriter = new WKTWriter();
for (int i = 0; i < t.rows(); i++)
for (int j = 0; j < t.cols(); j++)
StringBuilder sb = new StringBuilder();
if (!Double.isNaN(t.getDouble(j, i)))
Double elevation = t.getDouble(j, i);
Tuple2<Object, Object> longLatTupel = r.raster().rasterExtent().gridToMap(j, i);
if (longLatTupel._2() != null && longLatTupel._1() != null)
Double latitude = Double.parseDouble(longLatTupel._2() + "");
Double longitude = Double.parseDouble(longLatTupel._1() + "");
Point point = geometryFactory.createPoint(new Coordinate(longitude, latitude));
sb.append(elevation).append(TAB_SEP);
sb.append(point);
list.add(sb.toString());




return list.iterator();

);


_










share|improve this question














enter image description hereWe are trying to convert lzw compressed raster(tiff) into text format(meaning extracting each pixel centroid and band1 value.. We see that some parts of the raster is missed while conversion.. however there is a pattern in miss data (data is coming in unequal striped pattern) Please see snapshot up .. Yellow dots shows the centroid converted while no overlap with yellow the data is missed while converting..



we have tried the tile size 128 and 256 but the output was different in both the cases



List<String> tiffExtensions = new ArrayList<>();
tiffExtensions.add(".tif");
tiffExtensions.add(".TIF");
tiffExtensions.add(".tiff");
tiffExtensions.add(".TIFF");

final scala.Option<CRS> crsNone = scala.Option.apply(null);
final scala.Option<Object> objectNone = scala.Option.apply(null);
final scala.Option<Object> numPartitionsObject = scala.Option.apply(new Integer(10));
final scala.Option<Object> tileSize = scala.Option.apply(Integer.parseInt("256"));
final scala.Option<Object> partitionBytes = scala.Option.apply(128l * 1024 * 1024);
HadoopGeoTiffRDD.Options options = new HadoopGeoTiffRDD.Options$().apply(
JavaConverters.asScalaIteratorConverter(tiffExtensions.iterator()).asScala().toSeq(), crsNone,
HadoopGeoTiffRDD.GEOTIFF_TIME_TAG_DEFAULT(), HadoopGeoTiffRDD.GEOTIFF_TIME_FORMAT_DEFAULT(), tileSize,
numPartitionsObject, partitionBytes, objectNone);
RDD<Tuple2<ProjectedExtent, Tile>> rasterImageRdd = HadoopGeoTiffRDD.spatial(new Path(rastedImageDir), options,
javaSparkContext.sc());
JavaRDD<Tuple2<ProjectedExtent, Tile>> rasterImageJavaRdd = rasterImageRdd.toJavaRDD();
JavaRDD<String> pixelRdd = rasterImageJavaRdd
.flatMap(new FlatMapFunction<Tuple2<ProjectedExtent, Tile>, String>()
private static final long serialVersionUID = -6395159549445351446L;

public Iterator<String> call(Tuple2<ProjectedExtent, Tile> v1) throws Exception
ArrayList<String> list = new ArrayList<String>();
Tile t = v1._2;
ProjectedExtent projectedExtent = v1._1;
ProjectedRaster<CellGrid> r = new ProjectedRaster<CellGrid>(
new Raster<CellGrid>(t, projectedExtent.extent()), projectedExtent.crs());
GeometryFactory geometryFactory = new GeometryFactory(new PrecisionModel(), 4283);
WKTWriter wktWriter = new WKTWriter();
for (int i = 0; i < t.rows(); i++)
for (int j = 0; j < t.cols(); j++)
StringBuilder sb = new StringBuilder();
if (!Double.isNaN(t.getDouble(j, i)))
Double elevation = t.getDouble(j, i);
Tuple2<Object, Object> longLatTupel = r.raster().rasterExtent().gridToMap(j, i);
if (longLatTupel._2() != null && longLatTupel._1() != null)
Double latitude = Double.parseDouble(longLatTupel._2() + "");
Double longitude = Double.parseDouble(longLatTupel._1() + "");
Point point = geometryFactory.createPoint(new Coordinate(longitude, latitude));
sb.append(elevation).append(TAB_SEP);
sb.append(point);
list.add(sb.toString());




return list.iterator();

);


_







raster geotrellis






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 27 at 11:50









ashishashish

84 bronze badges




84 bronze badges















  • [enter image description here] at the beginning has the image that we are talking off

    – ashish
    Mar 27 at 11:52











  • The issue is that the yellow dots should be fully overlapped with the black points (We are simply extracting Lat/long and elevation values from a Raster Image). The portion of the image where yellow dots are not overlapped means the data has not been extracted for those points. The no data has been handled in line "Double.isNaN(t.getDouble(j, i)". There is nothing in-memory We have converted everything back into disk and visualizing the image on QGIS, I have updated the code snippet with comments which might help you in further understanding. I appreciate you helping on this

    – ashish
    Mar 28 at 5:28

















  • [enter image description here] at the beginning has the image that we are talking off

    – ashish
    Mar 27 at 11:52











  • The issue is that the yellow dots should be fully overlapped with the black points (We are simply extracting Lat/long and elevation values from a Raster Image). The portion of the image where yellow dots are not overlapped means the data has not been extracted for those points. The no data has been handled in line "Double.isNaN(t.getDouble(j, i)". There is nothing in-memory We have converted everything back into disk and visualizing the image on QGIS, I have updated the code snippet with comments which might help you in further understanding. I appreciate you helping on this

    – ashish
    Mar 28 at 5:28
















[enter image description here] at the beginning has the image that we are talking off

– ashish
Mar 27 at 11:52





[enter image description here] at the beginning has the image that we are talking off

– ashish
Mar 27 at 11:52













The issue is that the yellow dots should be fully overlapped with the black points (We are simply extracting Lat/long and elevation values from a Raster Image). The portion of the image where yellow dots are not overlapped means the data has not been extracted for those points. The no data has been handled in line "Double.isNaN(t.getDouble(j, i)". There is nothing in-memory We have converted everything back into disk and visualizing the image on QGIS, I have updated the code snippet with comments which might help you in further understanding. I appreciate you helping on this

– ashish
Mar 28 at 5:28





The issue is that the yellow dots should be fully overlapped with the black points (We are simply extracting Lat/long and elevation values from a Raster Image). The portion of the image where yellow dots are not overlapped means the data has not been extracted for those points. The no data has been handled in line "Double.isNaN(t.getDouble(j, i)". There is nothing in-memory We have converted everything back into disk and visualizing the image on QGIS, I have updated the code snippet with comments which might help you in further understanding. I appreciate you helping on this

– ashish
Mar 28 at 5:28












0






active

oldest

votes










Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55376490%2fmissing-pixels-when-extracting-each-pixel-value%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes




Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.







Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.



















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55376490%2fmissing-pixels-when-extracting-each-pixel-value%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현